Skip to content

Instantly share code, notes, and snippets.

@guisea
Created January 2, 2018 07:44
Show Gist options
  • Save guisea/7a055ccf59af482ed2935064555839f7 to your computer and use it in GitHub Desktop.
Save guisea/7a055ccf59af482ed2935064555839f7 to your computer and use it in GitHub Desktop.
PracticePython Exercise 01
# excercise01.py
from datetime import datetime
name = input('What is your name? ')
age = int(input('What is your age {}? '.format(name)))
year = int(datetime.now().year) # Retrieve current year based on system time
copies = int(input('How many lines to print? [default: 1 - Enter to accept]') or 1) # Default lines printed to 1
print(copies * "{0} you will be 100 years old in the year {1}\n".format(name,
((year - age) + 100)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment