Skip to content
dreamcode
dreamcode
Back to map
Default & keyword args · Lesson 17 of 44
+15 XP on finish
PYTHON BASICS

Defaults and keywords

You can give parameters default values. If the caller leaves them out, Python uses the default. You can also pass arguments by keyword (by name) instead of position.

How it reads
color="neon" sets a default value for color
glow(brightness=10) specifies brightness by name, while color defaults to "neon"
str(brightness) converts the integer to text so we can add it to other text
Cloud tip: All parameters with default values must come after parameters without default values.
main.py
PYTHON
real Python, runs in your browser
CONSOLE
- run your code to see output -