Skip to content

Instantly share code, notes, and snippets.

@coder-ralph
Last active March 27, 2023 02:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coder-ralph/be904d6c29436ed0459951058fa5afee to your computer and use it in GitHub Desktop.
Save coder-ralph/be904d6c29436ed0459951058fa5afee to your computer and use it in GitHub Desktop.
This function generates a holiday greeting with a variety of personalized elements.
# PythonPH - Holiday Coding Challenge
import random
# holiday greetings
def holiday_greeting(name, holiday):
greetings = ["Merry", "Happy", "Joyous", "Cheerful", "Festive"]
feelings = ["love", "joy", "peace", "happiness", "warmth"]
actions = ["spreading", "sharing", "bringing", "sending"]
greeting = random.choice(greetings) + " " + holiday + ","
feeling = "filled with " + random.choice(feelings) + ","
action = "and " + random.choice(actions) + " " + random.choice(feelings) + " to all!"
return greeting + " " + name + "! We hope your holiday is " + feeling + " " + action
print(holiday_greeting("PythonPH Fam", "Holidays"))
print(holiday_greeting("everyone", "Christmas"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment