Skip to content

Python Programming · Week 3

Inputs

Step 1 of 4

Exercise 1: Understanding Inputs

Inputs are simply data that the user provides to the computer. This can be incredibly useful as they can be used for many things.

Here is the basic input function:

input()

Inputs are stored in variables from where they can be easily manipulated to perform other tasks.

variable = input()

Inside the brackets of the input function, you must place the input message, which simply prints before you ask the user for their input.

input("Please enter your name: ")

Try it Yourself

Practice writing different input statements!

Starter code
# practice writing a variety of input statements!
variable1 = # TODO: replace and write an input statement
variable2 = # TODO: replace and write a second input statement
variable3 = # TODO: replace and write a third input statement

# TODO: print the three variables

Write your code here