JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Debug 4.1. Missing Number
Share
Explore
Gallery
Solution Debug 4.1. Missing Number
Solution Debug 4.1. Missing Number
Solution
The Task
Python Starter Code
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.
https://replit.com/@STACSSupport/Teachers-Debug-41-Missing-number?v=1
solution
# ask user for first number and stores user input
numberOne
=
int
(
input
(
'Enter the first number: '
)
)
# ask user for second number and stores user input
numberTwo
=
int
(
input
(
'Enter the second number: '
)
)
# calcualates numberOne + numberTwo and stores answer
additionAnswer
=
numberOne
+
numberTwo
# prints a blank line
print
(
'\n'
)
# display addition sum and answer
print
(
str
(
numberOne
)
+
" + "
+
str
(
numberTwo
)
+
" = "
+
str
(
additionAnswer
)
)
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.