Egg Sandwich! (Default Values) - Python Core | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Egg Sandwich! (Default Values) - Python Core

You are given a function for a hotel booking service. The First argument is the number of people staying in the hotel room, the second is the number of days, and the third is for breakfast option choice. Taking into account that visitors do not always mention their breakfast choice, we need to set the "Egg Sandwiches" option as the default. Complete the function so that the given code works correctly. Notice that values with the default parameters must come after parameters that don't give it. #change the function def book(people, days, breakfast="Egg Sandwiches"): print("People:", people) print("Days:", days) print("Breakfast:", breakfast) book(5,3, "Peanut Butter Bites") book(4,5) I added "Egg Sandwiches" to the code but it says there's not input. I'll revisit the exercises until someone can help me understand why that didn't work.

18th Aug 2021, 4:28 PM
Cory Peitsch
Cory Peitsch - avatar
1 Answer
+ 2
I solved the issue with the code, I needed to change 'book' to 'function'
18th Aug 2021, 4:33 PM
Cory Peitsch
Cory Peitsch - avatar