Abstract
By now, I’m sure you are getting a bit impatient. All right—all these data types are just dandy, but you can’t really do much with them, can you?
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
This will work only in a script, and not in an interactive Python session. In the interactive session, each statement will be executed (and print its contents) separately.
- 2.
At least when we’re talking about built-in types—as you see in Chapter 9, you can influence whether objects you construct yourself are interpreted as true or false.
- 3.
As Python veteran Laura Creighton puts it, the distinction is really closer to something vs. nothing, rather than true vs. false.
- 4.
In fact, you can supply exec with two namespaces, one global and one local. The global one must be a dictionary, but the local one may be any mapping. The same holds for eval.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Magnus Lie Hetland
About this chapter
Cite this chapter
Hetland, M.L. (2017). Conditionals, Loops, and Some Other Statements. In: Beginning Python. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0028-5_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0028-5_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0029-2
Online ISBN: 978-1-4842-0028-5
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)