
livia salgado
4,407 Pointswhile true: vs while True: why if i use the first one it shows error? why it has to be capitalized
the console showed error on the line while true: i realiza i had t instead of T, why that is important that's the difference, thanks!
1 Answer

Jennifer Nordell
Treehouse TeacherHi there! It's because True
is a reserved word in the Python language, but true
is not. The True
value is a built-in constant and is part of the language. If you try and use true
, it thinks you're trying to reference a variable name. Almost everything in programming is case-sensitive. This is true regardless of which language you're working with.
Here's some documentation on built-in constants in Python.
Hope this helps!
livia salgado
4,407 Pointslivia salgado
4,407 Pointsthank you!