Skip to Content
Python Crash Course, 3rd Edition
book

Python Crash Course, 3rd Edition

by Eric Matthes
January 2023
Intermediate to advanced content levelIntermediate to advanced
552 pages
13h 38m
English
No Starch Press
Content preview from Python Crash Course, 3rd Edition

8 Functions

In this chapter you’ll learn to write functions, which are named blocks of code designed to do one specific job. When you want to perform a particular task that you’ve defined in a function, you call the function responsible for it. If you need to perform that task multiple times throughout your program, you don’t need to type all the code for the same task again and again; you just call the function dedicated to handling that task, and the call tells Python to run the code inside the function. You’ll find that using functions makes your programs easier to write, read, test, and fix.

In this chapter you’ll also learn a variety ...

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

Automate the Boring Stuff with Python, 2nd Edition

Automate the Boring Stuff with Python, 2nd Edition

Al Sweigart

Publisher Resources

ISBN: 9781098156664