User Input

Slide 2

We can get user input by using the input() function.

 

The code will stop and wait for you to do something.

 

Type something in, and it will repeat what you typed.

There’s more than we can do with this…

Slide 3

We can stop a code to make sure the user is ready.

 

This code will stop for the user to do something before the punchline.

Slide 4

We can save what the user said in a variable!

 

Notice that it doesn’t show what the user typed.

Slide 5 You Try

Make a questionnaire. Use input and %s to accomplish this.