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 recursive function to return the nth Fibonacci number in Python


How would you loop over every key and value in a python dictionary?


[Exam style] Python is an interpreted language. Explain what this means and how interpreted languages differ from compiled languages.


Generate an array of integers from 0 to 99 and split it into two smaller arrays. Each smaller array will contain half of the original.