I want to set a variable in Python to true or false. But the words true
and false
are interpreted as undefined variables:
#!/usr/bin/python
a = true;
b = true;
if a == b:
print("same");
The error I get:
a = true
NameError: global name 'true' is not defined
What is the python syntax to set a variable true or false?
Python 2.7.3
question from:https://stackoverflow.com/questions/12644075/how-to-set-python-variables-to-true-or-false