Skip to content
dreamcode
dreamcode
Back to map
Helper functions · Lesson 19 of 44
+15 XP on finish
PYTHON BASICS

Combining functions

Great programs are built from tiny, reusable blocks. You can call functions from inside other functions, passing the output of one function as the input to another.

How it reads
add_stars(5) returns 15
format_sky(total) takes 15 and returns "Sky with 15 stars"
Cloud tip: Writing small helper functions makes your code much easier to read, test, and debug.
main.py
PYTHON
real Python, runs in your browser
CONSOLE
- run your code to see output -