1my_str = ""
2if not my_str:
3 print("empty")
4else:
5 print("not empty")
6#output: empty
1
2#variable
3var = "hello python"
4
5#check is not null
6if var is not NaN:
7 print('Var is not null')
8
9
1a_variable = {}
2
3is_a_empty = bool(a_variable)
4
5print(is_a_empty)
6# >>> False
7
8
9b_variable = [1, 2, 3]
10
11is_b_empty = bool(b_variable)
12
13print(is_b_empty)
14# >>> True