NameError: name 'true' is not defined [closed] NameError: name 'true' is not defined [closed] python python

NameError: name 'true' is not defined [closed]


Python’s boolean constants are capitalized: True and False with upper case T and F respectively.

The lower-case variants are just valid free names for variables, so you could use them for whatever you want, e.g. true = False (not recommended ;P).


You haven't defined a variable true. Maybe you meant the built-in boolean value True?


while True:

# but seems like inifite loop