Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What keyword is used to define a function in Python?
Think about the beginning of the function declaration.
Write a simple function that prints 'Python is fun!' and call it.
Remember to include parentheses when calling the function.
What is the purpose of the def keyword?
Think about how you start to write a function.
True or False: A function can have multiple return statements.
Consider how a function can be structured.
Write a function called analyze_list that takes a list of numbers and returns their average, maximum, and minimum values.
Use built-in functions to help determine average, max, and min.
Create a function called describe_person that accepts a name and an age, and prints a description. If age is not provided, assume it is 30.
Think about how to use default parameters in function calls.
6 more questions in this section. Enroll free to practise them all.
Enroll free