JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Pizza Planet
Share
Explore
Gallery
Solution Pizza Planet
Solution Pizza Planet
Solution
Python Starter Code
The Task
Code Clips
Solution
At the right hand side is the
the task, starter code and code clips
that pupils got.
Below is a link to the solution. You can right click
open on replit
to demo the answer to pupils and talk through the code.
Incase it doesn’t load above here is the link
https://replit.com/@STACSSupport/Teachers-Pizza-Planet?v=1
import
time
# start your program below
# prompt user and store input values
# ask for and store name of pizza
pizza
=
input
(
"Please enter the type of pizza: "
)
# ask for and store number of slices
slices
=
int
(
input
(
"Please enter the number of slices you want: "
)
)
# ask for and store the cost of pizza
cost
=
float
(
input
(
"Please enter the pizza price: "
)
)
# display outputs
# display thank you
print
(
'We are processing your order...'
)
# with a new line
# pauses program for 3 seconds
time
.
sleep
(
3
)
# clears the screen
print
(
'\033[H\033[2J'
)
# displays a blank line
print
(
'\n\n'
)
# displays ordered accepted notice
print
(
'Pizza Planet - Order Accepted'
)
# with a new line
print
(
'-----------------------------'
)
# with a new line
# displays a blank line
print
(
'\n'
)
# displays order details
print
(
'You will pay £'
+
str
(
cost
)
+
' for '
+
str
(
slices
)
+
' slices of '
+
pizza
+
' pizza'
)
# with a new line
# displays a blank line
print
(
'\n'
)
# displays ordered accepted notice
print
(
'It will be with you shortly.'
)
# with a new line
print
(
'Thank you for your order.'
)
# with a new line
Gallery
Share
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.