Let’s see how to check if string is empty. This is the problem I faced.
The way I handled the issue is to check the length of the string.
The code
The code I used to check the length of the string:
my_string = "" if len(my_string)==0: print("string is empty")

If the length of string equals 0 then it means that the string is empty.