Skip to content

Instantly share code, notes, and snippets.

@chriscarrollsmith
Last active September 8, 2024 17:55
Show Gist options
  • Save chriscarrollsmith/818a42a2b9a038d619a2fca8af98e1cf to your computer and use it in GitHub Desktop.
Save chriscarrollsmith/818a42a2b9a038d619a2fca8af98e1cf to your computer and use it in GitHub Desktop.
That feeling when you're falling in love with Python for the very first time
def greet():
# You are my heart
my_heart = {"my <3": "you"}
# My heart stops when you enter the room
sentiment = "Be still, my beating <3!".replace("beating ", "")
# Unlock me baby
key_to_my_heart = list(my_heart.keys())[0]
# I carve out my heart and replace it with you
epiphany = sentiment.replace(key_to_my_heart, my_heart[key_to_my_heart])
# Well, hello there ;)
come_on = epiphany.replace("Be still", "Hello")
# You are my world
afterglow = come_on.replace("you", "world")
# I roll over in the morning and whisper,
return afterglow
greet()
# 'Hello, world!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment