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 ▸

What is the difference between a cycle "if" and "while"?


Ask the user for a number and output the smallest divisor, bigger than one, for the inputted number. Output "Prime" if the number is a prime number.


What can I do with Python?


Using the shared code editor, write a recursive function for calculating a factorial of an input parameter.