Wednesday, November 16, 2022

Strings and Variables 2 - Python Programming for Beginners Practice Exercise

Exercise 2:

Write a Python program that prompts the user for input and simply repeats what the user entered.

Sample Output:

Please type something and press enter: Hello there!
You entered:
Hello there!

Solution:

#!/usr/bin/env python3

user_input = input('Please type something and press enter: ')
print('You entered:')
print(user_input)

No comments:

Post a Comment