endrytama
12/31/2017 - 4:01 AM

Python Practice - Exercise 1 (rrosinante)

Python Practice - Exercise 1 (rrosinante)

from datetime import datetime  # importing datetime module

# program that ask user their name and age, also show the years they will turn 100 years old
# Extra1 = ask user a number
# Extra2 = print message x times by Extra1 integer

# ask their name and age
name = input('Whats your name?: ')
age = int(input('how old are you?: '))

# declare current year
time = datetime.now()
currYear = time.year

year_until = 100 - age
year_of = currYear + year_until

message = "Hello " + name + " your age is " + str(age) + " and it will be " + str(year_of) + " for your 100th birthday\n"
print(message)

# Extra1 and Extra2
fun = int(input("Pick random number from 1 to 20: "))

print(fun * message)