
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
10 questions
PR1 QUALITATIVE RESEARCH INTRODUCTION & BACKGROUND OF THE STUDY
Presentation
•
9th - 12th Grade
9 questions
Domain 1 - Lesson 3: Configure Drive Encryption
Presentation
•
9th - 12th Grade
10 questions
Operators in Python
Presentation
•
9th - 12th Grade
10 questions
Writing an equation from a graph
Presentation
•
9th - 12th Grade
10 questions
Domain 2 Lesson 3
Presentation
•
9th - 12th Grade
9 questions
Y = MX + B Review
Presentation
•
9th - 12th Grade
11 questions
Teenager 5 Session 24: Pronunciation & Speaking
Presentation
•
KG
11 questions
Spanish 1 Los #s 20-100
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade