173k views
1 vote
In PyCharm, write a program that prompts the user for their name and age. Your program should then tell the user the year they were born. Here is a sample execution of the program with the user input in bold:What is your name? AmandaHow old are you? 15Hello Amanda! You were born in 2005.

User Dbmikus
by
4.5k points

1 Answer

5 votes

Answer:

def main():

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

if not name == "" or "":

age = int(input("What is your age? "))

print("Hello " + name + "! You were born in " + str(2021 - age))

main()

Step-by-step explanation:

Self explanatory

User Xtratic
by
5.0k points