Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What does the return keyword do in a function?
Think about what happens when a function finishes running.
Write a simple function that returns the value 2 + 2.
Make sure to use the return keyword!
What does the return keyword do in a function?
Consider what happens at the end of a function.
True or False: If a function does not have a return statement, it automatically returns None.
Think back to how functions behave.
Write a function that calculates the square of a number and the original number. What should be returned and how can it be used?
What will you need to return in order to get both values?
Create a function that takes a list and returns the minimum and maximum values. How will you implement this?
Think about how to find the values within the list!
5 more questions in this section. Enroll free to practise them all.
Enroll free