Glossary
HTML
CSS
JavaScript
Python

PYTHON

True in PYTHON

There's a special value that's neither a string nor a number: True.

There are no quotes around it, and it's not a numeric value.

 

 

True is great for situations like checking if a feature is on or if data is available. We can see it here when we set powered_on to True.

Python

powered_on = True

 

 

We can store True in a variable just like a string or a number. Displaying it also works the same, like when we display correct here.

Python

correct = True
print(correct)
Learn to Code in Python for Free
Start learning now
To advance beyond this tutorial and learn Python by doing, try the interactive experience of Mimo. Whether you're starting from scratch or brushing up your coding skills, Mimo helps you take your coding journey above and beyond.

Sign up or download Mimo from the App Store or Google Play to enhance your programming skills and prepare for a career in tech.

You can code, too.

© 2023 Mimo GmbH