Make the Machine Ask You Something
Explore how to get user input and convert data types.
We'll cover the following...
We'll cover the following...
So far, we’ve been instructing Python on what to do. Now, let’s make Python ask us something!
This lesson will teach us to use the input()
function to create simple, interactive programs.
Python wants to know you
Note: After you run the widget below, you’ll be expected to enter the input. Click inside the terminal window to type your input.
name = input("What is your name? ") print("Hello,", name)
Asking for user input and printing a response
...