Define a function that takes in the age of the user and adds it to an output sentence such as "You are ..... old".

def userName(): age = int(input("How old are you? ")) print(("You are {} old.").format(age))userName()

LR

Related Python Mentoring answers

All answers ▸

Write a short program to print all the even numbers 1 to 100


Create an rock, paper, scissors game. The user should input one option, and the computer should play randomly.


What are docstrings and how do I use them to improve my code readability?


How do I check if a number is prime using a python program?