input

6 min · 10 quiz questions

Year 7 · Chapter 5 From Scratch to Python · Lesson 12. This lesson goes with level 13 of the Byte Lab game. Play the level first, then use this page to revise.

Learning objectives. By the end of this lesson you should be able to use input( ) to ask the user a question; explain why input always gives a string; use int( ) and float( ) to turn the answer into a number; predict what a program prints from what the user types; fix ValueError and TypeError; and stop a program with Ctrl + C.

In this lesson

  • Asking the user
  • input always gives a string
  • Turning the answer into a number
  • Errors with input
  • Testing your program
  • Stopping a program
  • Shortcuts to know
  • Real mission: write chat_bot.py
  • Revision checklist