Vérifiez si la chaîne est vide Python
my_str = ""
if not my_str:
print("empty")
else:
print("not empty")
#output: empty
Doubtful Dingo
my_str = ""
if not my_str:
print("empty")
else:
print("not empty")
#output: empty
#check is not null
if var is not None:
print('Var is not null')
strtest = "xxxxxx"
if strtest is not None:
print("strtest is not None")