0

enter image description here

Im very confused why the first 3 arnt all correct. As isn't true a keyword, it of course is a Boolean literal and is interchangeable with 1?

Chrismon Chin
  • 429
  • 2
  • 12

1 Answers1

2

True and False are not keywords, they are boolean values because they are associated with 1 and 0 respectively. For a complete list of keywords see Is it possible to get a list of keywords in Python?

Community
  • 1
  • 1
sawreals
  • 338
  • 4
  • 15
  • They're not literals either. You can assign `True = 12`, or even `import __builtin__; __builtin__.True = 12`, and change what `True` evaluates to, whereas you couldn't do that with a literal. – user2357112 Dec 17 '16 at 01:09
  • @user2357112 those updates you are referring to came about in Python 3.x.x I believe. In which case they are keywords, but the original question pertained to python 2.7. – sawreals Dec 17 '16 at 01:14
  • I'm saying that in 2.7, they are neither literals nor keywords. The fact that they're not one doesn't make them the other. – user2357112 Dec 17 '16 at 01:15