Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (2015) Number Game App Number Game Introduction

livia salgado
livia salgado
4,407 Points

while 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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi 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! :sparkles: