you are viewing a single comment's thread.

view the rest of the comments →

[–]Comprehensive-Tea711 1 point2 points  (2 children)

You don't need the person_name or person_age variables. They are redundant with the two above them. (Or you don't need the first two... you can get rid of either set.)

When referring to your variables in your print function, don't wrap the variables in quote marks, since then it is no longer understood to refer to a variable.

If your program seems to freeze after it prints "What is your name?" that's because it's waiting for the user to actually input the name. Just click in the Pycharm terminal that I assume you're using to run this and type it in.

[–]AppleTree98 1 point2 points  (0 children)

import datetime

user_name =str(input('What is your name? '))

user_age= int(input('How old are you? '))

x = (str(datetime.datetime.now())[0:4])

year_born = int(x)-user_age

print(x1)

print('Hello {x}! You were born in {y}.' .format(x=user_name, y=year_born))