Skip to Main Content
Python Workout
book

Python Workout

by Reuven M. Lerner
July 2020
Beginner to intermediate content levelBeginner to intermediate
248 pages
6h 58m
English
Manning Publications
Content preview from Python Workout

1 Numeric types

Whether you’re calculating salaries, bank interest, or cellular frequencies, it’s hard to imagine a program that doesn’t use numbers in one way or another. Python has three different numeric types: int, float, and complex. For most of us, it’s enough to know about (and work with) int (for whole numbers) and float (for numbers with a fractional component).

Numbers are not only fundamental to programming, but also give us a good introduction to how a programming language operates. Understanding how variable assignment and function arguments work with integers and floats will help you to reason about more complex types, such as strings, tuples, and dicts.

This chapter contains exercises that work with numbers, as inputs and as ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python for Data Science

Python for Data Science

Yuli Vasiliev
Robust Python

Robust Python

Patrick Viafore

Publisher Resources

ISBN: 9781617295508Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link