Last active
December 4, 2023 07:42
-
-
Save geroembser/8ea81e049c437126bb1fc12cef07d2f9 to your computer and use it in GitHub Desktop.
Happy Birthday
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 create_birthday_cake(): | |
# Define the reference date: October 24th, 2016 at 2pm | |
reference_date = datetime(2016, 10, 24, 14, 0, 0) | |
# Get the current system time | |
current_time = datetime.now() | |
# Calculate the difference | |
time_diff = current_time - reference_date | |
# Calculate years, days, and hours | |
years = time_diff.days // 365 | |
days = time_diff.days % 365 | |
hours = time_diff.seconds // 3600 | |
# Create the birthday cake message | |
birthday_message = f"Herzlichen Glückwunsch zum Geburtstag! \n\nSchön dass es dich gibt und danke, dich seit {years} Jahren, {days} Tagen und {hours} Stunden kennen zu dürfen!\n (und natürlich auf eine gute und erfolgreiche Zeit in Delft 😉)\n" | |
# Create the cake design | |
cake = """ | |
~ ~ | |
* * * * | |
* * | |
~ * * ~ * | |
* ~ * * ~ | |
) ( ) * | |
* ~ ) (_) ( (_) ) (_) ( * | |
* (_) # ) (_) ) # ( (_) ( # (_) * | |
_#.-#(_)-#-(_)#(_)-#-(_)#-.#_ | |
* .' # # # # # # # # # # # `. ~ * | |
: # # # # # # # # : | |
~ :. # # # # .: * | |
* | `-.__ __.-' | * | |
| `````\"\"\"\"\"\"\"\"\"\"\"````` | * | |
* | | ||\ |~)|~)\ / | | |
| |~||~\|~ |~ | | ~ | |
~ * | | * | |
| |~)||~)~|~| ||~\|\ \ / | * | |
* _.-| |~)||~\ | |~|| /|~\ | |-._ | |
.' '. ~ ~ .' `. * | |
: `-.__ __.-' : | |
`. `````\"\"\"\"\"\"\"\"\"\"\"````` .' | |
`-.._ _..-' | |
`````"\"\"\"-----------"\"\"\"````` | |
""" | |
return birthday_message, cake | |
# Generate the birthday message and cake | |
birthday_message, cake = create_birthday_cake() | |
# Output the message and cake | |
print(birthday_message) | |
print(cake) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment