The easiest approach - if you recognize that the argument is often a listing is :
List that area unit empty area unit thought-about to be False (or ’Falsey’) and then you'll use it as within the on top of snipping.
The on top of may be a quite common idiom: you'll usually see it or it’s equivalent in several places.
if list_var: print(‘List is not empty’) else: print(‘List is empty’)This works as a result of Python variables have the construct of ‘truthiness’: id est they'll be used if they need a True/False price.
List that area unit empty area unit thought-about to be False (or ’Falsey’) and then you'll use it as within the on top of snipping.
The on top of may be a quite common idiom: you'll usually see it or it’s equivalent in several places.