5. Input

  • Once you understand variables, you can take input from the keyboard and store it
  • All input from the keyboard is stored as a string
  • The example below asks the user to Enter something and stores the input in a variable called thing
thing = input(“Enter something: “)

Tasks

  1. Write a program that asks for a name, and prints out the name entered
  2. Modify the code to ask for both first name and surname, and print them out on a single line
  3. Add an additional line to print the first name 5 times
  4. Save, print and label your code

Extension

What happens if you ask for two numbers and try to add them together?