Question: Write a Python function hobby(name, activity) which takes two text strings as arguments: name (the name of a person) and activity (what the person likes
Write a Python function hobby(name, activity) which takes two text strings as arguments: name (the name of a person) and activity (what the person likes to do).
Return a text string that adds together the name, an empty space ' ', the word 'likes', another empty space ' ', the string what, and then a period '.'!
Use the docstring """This function says what a person likes to do""".
Finally, call your function with your own name and something that you like to do! Here is the result of a sample call:
|
# Main program (use your own name and what you like to do): print(hobby('Aidan', 'skiing')) |
|
Aidan likes skiing. |
# Main program (use your own name and what you like to do): print(hobby("Greg", "rock climbing"))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
