Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dsbass98

macrumors newbie
Original poster
Aug 5, 2014
1
0
Hi,
i'm just starting out on python. I'm learning boolean data types however every time time i enter a string into terminal, i receive this error message:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'true' is not defined
 
Upper case True and False

True and False are case sensitive upper case in Python:

>>> a=true
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'true' is not defined
>>> a=True
>>> print a
True
>>>

Quite confusing for C++ developers, where they are lower case.
 
Helps using your favorite text editor with syntax highlighting to remember syntax when jumping between different languages.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.