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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started