How to check whether a str(variable) is empty or not?
You could just compare your string to the empty string: But you can abbreviate that as follows: Explanation: An if actually works by computing a value for the logical expression you give it: True or False. If you simply use a variable name (or a literal string like “hello”) instead of a logical test, the rule is: An empty string … Read more