If you can read this screen, you have successfully begun your first coding activity and are ready to continue your exciting journey into the world of programming with CS in Schools!
The first activity that you’ll do is modify some Python code to perform a magic trick. SPOILER ALERT: the “magic” is actually just maths!
In the editor below, fill in the blanks (________
) so that the program does the maths trick described in the print
commands and then print
the result back to the user.
To test your code, Run
the program by clicking on the Run
button.
Need some help? Click here to reveal a video walkthrough for this task!
1
and 20
in the your_number
variable.print
commands. Finally, it should print
the result back to the user!0.0
instead of 0
, that’s okay!*
is for multiplication and /
is for division! Try using //
for division, what happens to the result?Below is an example of how the program should run:
I predict your FINAL ANSWER will be... ZERO!!!
Adding 2...
Tripling it...
Subtracting 6...
Dividing by 3...
Subtracting the original number...
I worked it out!
0.0
Was I correct??