Verifique se a variável está vazia python
if variable:
# code goes here...
IllegalBeagle123
if variable:
# code goes here...
if x:
print(x)
else:
print(x is empty)