num = '5'
result = num or None
print(result) # 5
num = ''
result = num or None
print(result) # None
I don't understand why this works because I thought "or" will check if one side is True and if so it will return True. But it returns either the value of num or None.