Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

karen wants to create a program that will allow the user to input their…

Question

karen wants to create a program that will allow the user to input their age. which of these lines of code should be used?
a. print(\what is your age?\)
b. age = (\what is your age?\)
c. age = input(\what is your age?\)
d. age = ask(\what is your age?\)

Explanation:

Brief Explanations

To get user input for age, the input() function in Python is used to prompt and receive user input. Option A just prints the message, Option B assigns a string to age (not input), Option D uses a non - existent ask() function. Option C uses input() with the prompt "What is your age?".

Answer:

C. age = input("What is your age?")