Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Define a function named say_hi that takes no parameters and prints Hi!.
Use the 'def' keyword followed by the function name.
Create a function named multiply that takes two numbers and prints their product.
Make sure to define parameters in parentheses.
What keyword is used to define a function in Python?
Think about the keyword that starts function definitions.
True or False: A function can take arguments.
Remember the examples we discussed involving parameters.
Write a function find_max that accepts a list of numbers and returns the largest number. Test your function.
Consider using built-in Python functions.
Define a function factorial that computes the factorial of a number using recursion.
Think about how factorial is defined mathematically.
5 more questions in this section. Enroll free to practise them all.
Enroll free