What does the input() function expect as a parameter?

QuestionsQuestions8 SkillsProYour First Python LabAug, 23 2025
0121

The input() function in Python expects a single optional parameter, which is a string that serves as a prompt message displayed to the user. This message indicates what kind of input is expected.

Here's the syntax:

input(prompt)
  • prompt: A string that is shown to the user before they enter their input. If no prompt is provided, the user will just see a blank line.

For example:

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

In this case, "What is your name? " is the prompt that appears to the user. If you have more questions, feel free to ask!

0 Comments

no data
Be the first to share your comment!