148k views
0 votes
Question #1

Dropdown
You have written many programs that get values from the user. Complete the code to get the user's response.
answer= ______ ("What is your name?")

User Snapfla
by
4.6k points

1 Answer

1 vote

Answer:

input("What is your name?")

The input function prompts the user to enter a value, and then returns the value as a string.

Here's an example of how you might use it in a program:

name = input("What is your name?")

print("Hello, " + name + "!")

This will print out a message like "Hello, John!" if the user enters "John" as their name.

User Hajpoj
by
4.0k points