Created
February 26, 2024 11:06
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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