
5.10.1: Functions and Parameters Quiz
Authored by Dawn Madden
Computers
10th Grade
Used 22+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
26 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the following code: size = 20 x = 200 y = 300 ball = Circle(size) circle.set_position(x, y) What is the meaning of the x variable?
The x coordinate of the left side of a box that would hold the circle
The x coordinate of the right edge of the circle
The radius of the circle
The x position of the center circle
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following program should draw a circle on the screen def draw_circle(x, y): circle = Circle(100) circle.set_position(x, y) But when we run this code, we don’t see the circle. What is missing?
Since we are trying to create a circle, we need to use the create_circle command.
The code will have an error since you need to define the color.
You need to add the circle with the circle.add() command.
You need to add the circle with the add(circle) command.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
We want to position a Circle on our screen to be at a random position, but we want to keep the entire shape on the screen. Which of the following will accomplish this given the following function? (Assume SIZE, HEIGHT, and WIDTH are properly defined) def draw_circle(x, y, radius): circle = Circle(radius) circle.set_position(x, y) add(circle)
x = random.randint(0, HEIGHT) y = random.randint(0, WIDTH) draw_circle(x, y, SIZE)
x = random.randint(SIZE, WIDTH - SIZE) y = random.randint(SIZE, HEIGHT - SIZE) draw_circle(x, y, SIZE)
x = random.randint(0, HEIGHT) y = random.randint(0, WIDTH) draw_circle(SIZE, y, SIZE)
x = random.randint(HEIGHT, SIZE) y = random.randint(WIDTH, SIZE) draw_circle(x, y, SIZE)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why do we write functions? I. Make our code easier to understand by giving a readable name to a group of instructions II. Avoid writing repeated code III. Make our code reusable
I and III
I only
I and II
I, II, and III
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the following function print_three_times: def print_three_times(word): print(word) print(word) print(word) What is the parameter of the function?
print_three_times
def
word
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following program? def sum_to(num): sum = 0 for i in range(num + 1): sum = sum + i return sum x = 5 sum_to(x) print(x)
5
15
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed by the following program? def print_numbers(two, one, zero): print(two) print(one) print(zero) zero = 1 one = 0 two = 2 print_numbers(zero, one, two)
2 1 0
0 1 2
ZERO ONE TWO
two one zero
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
22 questions
ASK Tingkatan 2 -(3.2 Struktur Kod Arahan - Ralat)
Quiz
•
1st - 12th Grade
21 questions
Libre Office Writer
Quiz
•
5th - 10th Grade
21 questions
Computer 10
Quiz
•
10th Grade
25 questions
Introduction to IT
Quiz
•
5th - 10th Grade
22 questions
Managing Edits and Document Layouts
Quiz
•
9th - 12th Grade
25 questions
SPREADSHEET
Quiz
•
10th Grade
22 questions
Python Data Types Quiz
Quiz
•
10th Grade
24 questions
2.1.1 & 2.1.2 Cyber CIA and Passive Analysis
Quiz
•
10th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
14 questions
[AP CSP] JavaScript Programming Quiz
Quiz
•
9th - 12th Grade
10 questions
Understanding Computers and Computer Engineering
Interactive video
•
7th - 12th Grade
37 questions
Python - Tuples, Lists, and List Methods
Quiz
•
9th - 12th Grade