Predict the Output
Beginner · Predict the output · from Python Functions: Define, Call, and Return Values
From the lesson: Python Functions: Define, Call, and Return Values
Imagine you have a favorite recipe for pancakes. Every Sunday morning, you follow the same steps: mix flour, crack eggs, pour batter, flip. You don't reinvent the recipe each time - you just follow the one you already know.
Read the lessonRead the code below carefully. What will it print? Type the exact output.
def double(x):
return x * 2
result = double(7)
print(result)
print(double(3))def double(x):
return x * 2
result = double(7)
print(result)
print(double(3))
More Function exercises
- Say HelloBeginner
- Area of a RectangleBeginner
- Fix the Broken FunctionIntermediate
- Temperature ConverterIntermediate
- Build a Grade CalculatorAdvanced
All Python exercises · 50 practice problems · Functions quiz