Skip to content
dreamcode
dreamcode
Lesson
Practice · Default & keyword args
  1. Predict
  2. Arrange
  3. Fill in
+20 XP on finish
PREDICT · READ BEFORE YOU WRITE

What is the output of this Python code?

Trace the program the way the computer would, then make your call before running anything.

def describe_sky(color="dark blue", moon=True):
    if moon:
        return color + " with a moon"
    return color + " and empty"

result = describe_sky(moon=False)
print(result)