
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
La libertad 2. El existencialismo
Presentation
•
KG
9 questions
D3L3: Describe Permissions
Presentation
•
9th - 12th Grade
10 questions
Domain and Range Lesson
Presentation
•
9th - 12th Grade
10 questions
Sum & Difference of Cubes
Presentation
•
9th - 12th Grade
10 questions
Six Trig Functions
Presentation
•
9th - 12th Grade
10 questions
Vocabulary in Context
Presentation
•
9th - 12th Grade
10 questions
Earth Sciences: Plate Boundaries
Presentation
•
9th - 12th Grade
9 questions
Solving Systems by Graphing
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Assessment 1
Quiz
•
3rd Grade
15 questions
HCS SCI 05 Summer School Assessment 1 Review
Quiz
•
5th Grade
22 questions
Day 9 Equations and Inequalities Review
Quiz
•
9th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
7 questions
PYRAMID PERSPECTIVES part 1
Presentation
•
9th - 12th Grade
12 questions
Understanding the Fourth of July
Quiz
•
9th Grade
15 questions
Soccer World Cup Quiz Questions
Quiz
•
7th Grade