zspann / cssi-prework-python-mothers-day

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Mother's Day!

Intro

Mother's Day is coming up, and you've been hired by Hallmark to develop some e-cards! We're going to write some functions to wish people Happy Mother's Day for us. You'll be coding your solutions in mothers_day.py.

Step 1 - A Function with No Arguments

Define a function, mothers_day, that returns a string that says "Happy Mother's Day, Mom!"

Step 2 - A Function with Arguments

Your Mothers Day function is great, but it can only wish a Happy Mother's Day to Mom! Some of your customers want to wish a Happy Mother's Day to their grandmothers, sisters, and friends. Create a new function called better_mothers_day so that it takes in a name and returns a personalized greeting. For example, calling better_mothers_day("Beyonce") should return "Happy Mother's Day, Beyonce!"

Step 3 - A Function with Default Arguments

Your new function is great, but sometimes we need to send a quick card and can't write in the whole name. We need to be able to send a card quickly with no arguments or the same card with a name. Create a function best_mothers_day() that has a default value. Calling best_mothers_day() returns "Happy Mother's Day, Mom!" and ``best_mothers_day("Beyonce")returns"Happy Mother's Day, Beyonce!"`

Step 4 - Multiple Arguments and More

Our function now works great for Mother's Day, but we want to let users customize it even more. Create a new function, holiday_greeting() that takes in a to, from, and a holiday and returns a personalized greeting. For example, calling holiday_greeting("Beyonce", "Jay-Z", "Fourth of July") should return "Happy Fourth of July, Beyonce! - From Jay-Z". If no arguments are specified, the function should return "Happy Mother's Day, Mom! - From Your Favorite Child"

Bonus

  • Create a file in this directory called holiday_greeting.py. First build out a command line user interface. It should:
    • Welcome the user to your program
    • Take in their to, from, and holiday inputs and store them in variables.
    • Run your function and show the user your results!

About

License:Other


Languages

Language:Python 100.0%