
CS2 Quest 5: Functions
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Easy
Maria Cruz Farooqi
Used 4+ times
FREE Resource
1 Slide • 13 Questions
1
CS2 Quest 5: Functions
By Maria Cruz Farooqi
Learning Target: I can write my own functions, use them in my code, explain why they make my programs easier to manage, and fix mistakes in function definitions.
2
Dropdown
3
Dropdown
4
Drag and Drop
5
Drag and Drop
6
Dropdown
7
Drag and Drop
8
Multiple Choice
What is the name of the function?
def
9
Multiple Choice
On what line is the function called?
10
Multiple Choice
What is the result of calling the function?
11
Match
Match the Key Terms
A block of organized, reusable code that is given a name.
The act of creating a new function.
Python Syntax:
def name():
code
The act of executing a function definition.
Python Syntax:
name(arguments)
The spaces found at the beginning of a line of code. Necessary to do after a colon in Python!
Function
Define
Call
Indent
Function
Define
Call
Indent
12
Multiple Choice
The following function is supposed to give your hero the power to patrol an area for enemies. If they find an enemy, your hero should attack. However, the function does not work as intended.
What is wrong? What would you do to fix this problem?
Change 'hero.attack(enemy)' to 'hero.defend( )'
The function definition looks good. It just hasn’t been called yet. Call it in the while True loop.
13
Multiple Choice
Do these functions produce the same output if called? If yes, what is the output of both. If no, explain how they differ.
No, they do not produce the same output. Algorithm A looks for an item while algorithm B looks for an enemy.
14
Video Response
Record a thank you to a peer that helped you with coding.

CS2 Quest 5: Functions
By Maria Cruz Farooqi
Learning Target: I can write my own functions, use them in my code, explain why they make my programs easier to manage, and fix mistakes in function definitions.
Show answer
Auto Play
Slide 1 / 14
SLIDE
Similar Resources on Wayground
11 questions
04.01 Databases
Presentation
•
9th - 12th Grade
12 questions
Dividing Polynomials--Long Division
Presentation
•
9th - 12th Grade
9 questions
¿Qué estudia la filosofía?
Presentation
•
KG
11 questions
Long & Short Term Goals
Presentation
•
9th - 12th Grade
11 questions
Origin of Life - Scientific Contributions
Presentation
•
9th - 12th Grade
11 questions
4tos Protocolos de red
Presentation
•
9th - 12th Grade
10 questions
El método científico
Presentation
•
10th - 12th Grade
10 questions
Solving Systems of Equations by Graphing
Presentation
•
9th - 11th Grade
Popular Resources on Wayground
15 questions
Grade 3 Simulation Assessment 1
Quiz
•
3rd Grade
22 questions
HCS Grade 4 Simulation Assessment_1 2526sy
Quiz
•
4th Grade
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
20 questions
Math Review
Quiz
•
3rd Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
20 questions
Inventor Terms Exercise #1a
Quiz
•
9th Grade
31 questions
Inventor Vocabulary Review Sheet
Quiz
•
9th Grade
26 questions
Final Exam Review 1
Quiz
•
11th Grade
10 questions
Exploring Cybersecurity Techniques and Threats
Interactive video
•
6th - 10th Grade