Python runs your code line by line and stops at the first mistake, naming it in the last line of the traceback. This set covers what a single = does, why a name that differs only in case is a different name, why the body of a loop is indented, and what the slice that reverses a string actually does. The task runs a few short lines and asks you to read what they print.
Each one is marked as you go, and the explanation arrives straight after, which is
the part worth reading.
4 questions, marked as you go.
Tasks
These need your own device. Run the command in Termux, then paste what it printed.
The marking looks at what the output means, so spacing, version numbers and
ordering do not matter. If you have not installed anything yet, the
lesson covers the setup.
Run a few lines and read the output
This runs four short pieces of Python in one go: a print statement, the arithmetic that works out the minutes in a week, a loop that adds every number from one to one hundred, and a slice that reverses a word. Paste all four lines it prints.
Run this in Termux
On your own device. Nothing on this page executes it. The command runs in
your terminal, and this box only reads what you paste back.
The third line is the total of the whole numbers from one to one hundred, and the fourth is Termux spelt backwards.
the print statement produced its line
the minutes in a week are worked out as 10080
the numbers from one to one hundred add up to 5050
the word was reversed
the command actually ran
What a good answer looks like
Four lines. The first is Hello from Python. The second is 10080, the minutes in a week: sixty minutes times twenty four hours times seven days. The third is 5050, the sum of the whole numbers from one to one hundred. The fourth is xumreT, which is Termux read backwards. If the second line is 1440 you worked out the minutes in a day and forgot to multiply by seven, which is the common slip.
Marking your own work
Both halves of this are checked in your browser, with no server involved, so nothing
stops you from pasting output you did not run. The tasks are written so that the
easiest way to pass one is to actually do it and read the result, which is the whole
intention.