2. Using a Prompt

In the example above, the user had to input their name on a new line. The Python input() function has a prompt parameter, which acts as a message you can put in front of the user input, on the same line.

Example: Add a message in front of the user input

name = input("Enter your name:")
print(f"Hello {name}")

Sample run:

Enter your name:Ada
Hello Ada