I believe this is what you're looking for.
def my_function(username, greetings):
print("Hello %s , I wish you %s"%(username, greetings))
username_input = input("enter your name:")
greetings_input = input("enter your greeting:")
my_function(username_input, greetings_input)
Explanation
def my_function()
has the function definition which takes two parameters i.e username
and greetings
as inputs to the function. The function prints the statement Hello ..., I wish you ...
with appropriate replacements
When you run the python code, the line username_input
requests the user for an input of the name and the result is stored in the variable. Similarly with greeting_input
.
You then have to call the function by using the name of the function i.e. my_function()
with the appropriate parameters taken as input. So the function call happens by doing my_function(username_input, greeting_input)
All the best with your learning. Hope this helps