Arguments, defaults, and the silent wrong-order bug — step 8 of 9
Write a function called greet that takes a name and an optional mood
parameter. mood should default to "good". The function should return the
string f"hi {name}, hope you're {mood}".
Then call greet twice and print both results:
greet("alex")— uses the defaultgreet("sam", "great")— overrides it
Expected output:
hi alex, hope you're good
hi sam, hope you're great
⌘↵ runs the editor.read, then continue.
Write a function called greet that takes a name and an optional mood
parameter. mood should default to "good". The function should return the
string f"hi {name}, hope you're {mood}".
Then call greet twice and print both results:
greet("alex")— uses the defaultgreet("sam", "great")— overrides it
Expected output:
hi alex, hope you're good
hi sam, hope you're great
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.