Question 4)
Write a Program in Python to take the user name and age and print it out on the console.
or
Write a Program in Python using the input function to accept the user name and age and print in the following format.
Hello {name}! Your age is {age}
Code Example:
# Program 4
# Print user name and age as input
# 1000+ Python Programs by Code2care.org
user_name = input("Enter your name: ")
user_age = input("Enter your age: ")
print(f"Hello {user_name}, your age is {age}")
Console Output:
Enter your name: Mike
Enter your age: 22
Hello Mike, your age is 22

Explanation:
We have made use of two functions here,
- print() - an inbuild function in Python 3 - read more, we make use of the f-strings along with print function to get the desired result.
- input(prompt) - an inbuild function again, with the prompt string that is printed out to the standard output without a trailing newline - read more
Varaibles user_name and user_age are used to store the input from the user and then printed using the print function in f-strings format.

-