Truthy and Falsey

Run Settings
LanguagePython
Language Version
Run Command
#Truthy and falsy values in Python refer to the boolean evaluation of #non-boolean objects. When a value is used in a boolean context, such as in an #if statement or a while loop, Python implicitly converts it to a boolean value #(True or False). Values that evalute to True are considered "truthy," while #those that evalue to False are considered "falsy." #The following values are considered falsy in Python: # False # None # 0(integer) # 0.0(float) # 0j(complex number) # ''(empty string) # [](empty list) # ()(empty tuple) # {} (empty dictionary) # set() (empty set) # range(0) (empty range) password = '' #empty string considered false username = 'johnny' if password and username: print('you are old enough to drive, and have a license') else: print('you are not of age')
Editor Settings
Theme
Key bindings
Full width
Lines