Skip to content

Instantly share code, notes, and snippets.

@gonaumov
Created February 26, 2024 11:06
Show Gist options
  • Save gonaumov/4552ec8b533e7d9b8c0cc0b11b65f1d8 to your computer and use it in GitHub Desktop.
Save gonaumov/4552ec8b533e7d9b8c0cc0b11b65f1d8 to your computer and use it in GitHub Desktop.
A simple script which displays how many years ago was written "The Prince" by Machiavelli.
from datetime import datetime
def years_until_now(input_year):
return int(datetime.now().strftime('%Y')) - input_year
the_prince_written_year = 1513
print(f'"The prince" was written {years_until_now(the_prince_written_year)} ago.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment