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
8.4k 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
7.5k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.