How did I write the following five things in Python?
Ask the user for their first name
Say “Hello” followed by the user’s first name
Ask the user how old they are
Tell the user how old they will be in 10 years and in 20 years
Tell the user how old they were 5 years ago

Respuesta :

name = input("What is your first name? ")

print("Hello "+name)

age = int(input("How old are you? "))

print("In 10 years, you will be "+str(age+10))

print("In 20 years, you will be "+str(age+20))

print("5 years ago you were "+str(age - 5))

I hope this helps!

The program is an illustration of a sequential program.

Sequential programs are programs that do not require loops or conditional statements

The Python program

The program written in Python, is as follows:

#This gets input for first name

firstName = input("Your first name: ")

#This prints Hello, followed by the first name

print("Hello "+firstName)

#This gets input for age

yourAge = int(input("Your age: "))

#The next three lines print the ages in 10, 20 and -5 years time

print("You will be "+str(yourAge+10)+" in 10 years")

print("You will be "+str(yourAge+20)+" in 20 years")

print("You were "+str(yourAge-5)+", 5 years ago")

Read more about programs at:

https://brainly.com/question/24833629

#SPJ2