© Magnus Lie Hetland 2017

Magnus Lie Hetland, Beginning Python, 10.1007/978-1-4842-0028-5_5

5. Conditionals, Loops, and Some Other Statements

Magnus Lie Hetland

(1)Trondheim, Norway

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?

Let’s crank up the pace a bit. We’ve already encountered a few statement types (print statements, import statements, and assignments). Let’s first take a look at some more ways of using these before diving into the world of conditionals and loops. Then we’ll see how list comprehensions work almost like conditionals and loops, even though they are expressions, and finally we’ll take a look at pass, del, and exec.

More About print ...

Get Beginning Python: From Novice to Professional, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.