Can We Order?
The order is ready, but can you send it right now? The pizzeria takes orders every day except Monday, from 11:00 to 21:59. Two new variables say when you're ordering: day is the day of the week, and hour the hour, a whole number from 0 to 23.
At the end, the program prints one more line: You can order now. if the pizzeria takes orders at that moment, and The pizzeria is closed now. if it doesn't. It's Sunday, 22:00, which is too late, so the output ends like this:
Total: 60 EUR
Per guest: 5.0 EUR
The pizzeria is closed now.The exercise checks the program at other times too, so make sure it's right at any time, not only now: on Sunday at 21, you can order; on Monday at 18, the pizzeria is closed, and on Tuesday at 10, too.
That's the whole project. With just two lessons behind you, you've written a program that plans a party: it calculates with variables, makes decisions with conditions and prints a clear report with f-strings. In the next lesson, you'll learn about lists, which hold many values in one variable, such as the orders of all your friends.
Instructions
Print whether you can order now. With the values in the program, the last line is The pizzeria is closed now.
Start programming for free
3/3