Practice Return Values - 6.4 | Functions in Python | Python Programming Language
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Return Values

6.4 - Return Values

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What does the return keyword do in a function?

💡 Hint: Think about what happens when a function finishes running.

Question 2 Easy

Write a simple function that returns the value 2 + 2.

💡 Hint: Make sure to use the return keyword!

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does the return keyword do in a function?

It prints data
It creates a variable
It sends back a value

💡 Hint: Consider what happens at the end of a function.

Question 2

True or False: If a function does not have a return statement, it automatically returns None.

True
False

💡 Hint: Think back to how functions behave.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a function that calculates the square of a number and the original number. What should be returned and how can it be used?

💡 Hint: What will you need to return in order to get both values?

Challenge 2 Hard

Create a function that takes a list and returns the minimum and maximum values. How will you implement this?

💡 Hint: Think about how to find the values within the list!

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.