Quarry School

Read a reply from the keyboard — quick review

In plain words

Imagine a school fair with a badge marked 04 and four spare badges on a tray.

Rule

Keep the reply as text for a badge code, where every character matters. For a count written in digits, convert the reply with int(reply) before adding to it.

Step

  1. Type the Python source, the lines of code shown below, in your editor. Keep the blank line after reply = input() and save the file.

  2. Run the saved file with Python 3.13. The input() call has empty parentheses, so it waits for your reply without displaying a message asking for it. Type the two digits 04 where the program is running and press Enter.

  3. Compare the two lines the program prints with the expected output. The Shell can show your typed reply above those lines. If you’re working on paper, follow the code one line at a time and write down what each print() displays.

Trap

A reply can look like a number and still be text. Writing reply + 1 skips the conversion. Use int(reply) + 1 for the count. For this version, enter a whole number written in digits, such as 04 or 8. The word four is outside the form that int() can convert here.