
Python Functions

Quiz
•
Computers
•
12th Grade
•
Medium
DLM DLM
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the scope of a variable defined inside a function in a coding bootcamp?
The scope is global and accessible from any function
The scope is limited to the function where it is defined.
The scope is limited to the entire coding bootcamp program
The scope is limited to the block where the function is defined
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the difference between ordering food online and dining in a restaurant.
Ordering food online is done through a website or app, while dining in a restaurant involves physically going to the restaurant.
Ordering food online and dining in a restaurant are the same in terms of convenience and experience.
Dining in a restaurant involves physically going to the restaurant, while ordering food online is done through a website or app.
Dining in a restaurant is done through a website or app, while ordering food online involves physically going to the restaurant.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How would you define a recipe in Python?
recipe_name(ingredients):
define recipe_name(ingredients):
def recipe_name:
def recipe_name(ingredients):
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Imagine a scenario where John is a carpenter working on a project. He has a function called calculate_total_cost that calculates the total cost of materials and labor. The function takes two parameters, material_cost and labor_cost, and returns the sum of the two. What will be the output when John calls calculate_total_cost with material_cost as $300 and labor_cost as $400?
$3
$8
$7
$10
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Identify the error in the following recipe function:
def bake_cake(flour, sugar):
mix = flour + sugar
return mix
print(bake_cake(2))
The function should be defined as bake_cake(flour, sugar=1)
The function call should be corrected to bake_cake(2, 3) where 3 is the second ingredient.
The function should return flour - sugar instead of flour + sugar
The function should have a default value for sugar
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'global' keyword do in a programming project?
Creates a new variable in the project scope
Automatically initializes a variable with a default value
Modifies a variable outside of the current scope
Allows access to built-in project functions
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the components of a recipe header in a cookbook.
Method name, ingredients, cooking instructions
Recipe name, steps, serving size
Name, ingredients, cuisine type
Recipe name, ingredients, cooking time
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
function in python

Quiz
•
12th Grade
15 questions
Gateway Level 3 Python Quiz 3

Quiz
•
9th - 12th Grade
20 questions
Gateway Level 3 Python Quiz 2

Quiz
•
9th - 12th Grade
15 questions
Lập trình hướng đối tượng

Quiz
•
1st - 12th Grade
18 questions
CS Unit 1, Programming part 1: Sequences

Quiz
•
9th - 12th Grade
19 questions
Computer Science Quiz 02

Quiz
•
10th Grade - University
25 questions
Final Exam P2Q2

Quiz
•
12th Grade
20 questions
Python - 1

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade