This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
What keyword is used to define a function in Python?
function
def
func
What does a function return if it has no return statement?
return
0
An empty string
None
You have code in a file named math_utils.py. How do you use its add() function from another file in the same folder?
math_utils.py
add()
import math_utils and then call math_utils.add(...).
import math_utils
math_utils.add(...)
include math_utils.py and then call add(...).
include math_utils.py
add(...)
You must copy the add() function into every file that needs it.
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?