Introduction
In this lab, you will learn how to check if a function returns None
in Python. The lab guides you through understanding function return values by creating a simple Python script with a function that returns the sum of two numbers. You will then execute the script and observe the output.
The lab continues by modifying the function to return different data types, and ultimately focuses on scenarios where a function might not explicitly return a value, resulting in a None
return. You will learn how to capture the return value of a function and then check if that value is None
using the is
operator.