left, middle, right = pygame.mouse.get_pressed()
if left:
print("Left Mouse Key is being pressed")
Python Pygame
Quiz
•
Computers
•
12th Grade
•
Hard
Quizizz Content
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
left, middle, right = pygame.mouse.get_pressed()
if left:
print("Left Mouse Key is being pressed")
The above code, as long as the mouse is being held down, it will keep printing
Returns the coordinates of the mouse cursor on the screen
The above code changes the type of cursor that appears on the screen
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code do?
color = (random.randint(0,255), random.randint(0,255), random.randint(0,255))
choose a random color
fill the surface with random color
change the background color according to the key pressed
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do I update the screen?
import pygame
pygame.init()
surface = pygame.display.set_mode((400,300))
pygame.display.flip()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Set image background
bg1 = pygame.image.load("back1.jpg")
surface.blit(bg1, (0, 0))
bg1 = pygame.image.load("back1.jpg")
surface = pygame.display.set_mode((800,500))
bg1 = pygame.image.load("back1.jpg")
pygame.display.set_caption("Animation")
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code do?
if x >= 500: x = 0
x += 3
surface.fill((255, 255, 255))
circle = pygame.draw.circle(surface, (0, 0, 255), (x, y), 15)
pygame.display.update()
move the circle to right
create a surface
set initial position of the circle
check whether the circle pos. reached at the end
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do I import the pygame library?
import pygame
pygame.init()
surface = pygame.display.set_mode((400,300))
pygame.display.flip()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is this function following the code?
event.button = 3
pressing the left button
pressing the right button
scrolling forward
scrolling back
20 questions
UH Pygame - Vol. 1
Quiz
•
9th - 12th Grade
20 questions
المكتبات البرمجية
Quiz
•
12th Grade
15 questions
Exploring PyGame Fundamentals
Quiz
•
12th Grade
22 questions
VII разред: Python - Pygame
Quiz
•
1st - 12th Grade
20 questions
Computer Components
Quiz
•
8th - 12th Grade
23 questions
HTML Practice 3 of 4
Quiz
•
11th - 12th Grade
20 questions
JavaScript Game Development Newton
Quiz
•
9th Grade - University
20 questions
AVALIAÇÃO DE PENSAMENTO COMPUTACIONAL VALOR 40
Quiz
•
10th Grade - University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University