Last active
March 27, 2023 02:34
-
-
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.
This file contains 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
# 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