Greetings with personalized drink offers

Report a typo

You are hosting a party, and you want to personally greet each of your friends in a unique way when they arrive. You have decided to use their names and their favorite drinks in your greetings. Write a program that takes two inputs, a friend's name and their favorite drink.

Your program should print a message that says, "Hello [Friend's name], I hope you are having a wonderful day! Would you like a glass of [Favorite drink]?" Only the first letter of the friend's name and the drink should be capitalized.

Sample Input 1:

John
Water

Sample Output 1:

Hello John, I hope you are having a wonderful day! Would you like a glass of Water?

Sample Input 2:

marie
coffee

Sample Output 2:

Hello Marie, I hope you are having a wonderful day! Would you like a glass of Coffee?
Write a program in Python 3
# Python code to greet a friend in a unique way

# Function to create a greeting for a friend
def create_greeting(friend_name, favorite_drink):
# Write your code here to format the string.
# Make sure to capitalize the first letter of both 'friend_name' and 'favorite_drink'.

# Taking user's input
name_input = input()
drink_input = input()

# Call function and print the greeting
print(create_greeting(name_input, drink_input))

Create a free account to access the full topic