Font size
Worksheetspython pygame
Total questions: 44
Worksheet time: 29mins
Pygame library
What is Pygame?
Pygame is a programming language.
Pygame is a software for editing images.
Pygame is a type of puzzle game.
Pygame is a set of Python modules used to create video games.
Which of the following is the correct way to install Pygame?
pip install pygam
pip install pygame
pip install pygame
pip install pygames
What is the first step to create a game window in Pygame?
Import the pygame module
Create a game loop
Install the pygame module
Define the game window size
Which module is used to connect the Pygame library?
pygame.connect
pygame.library
pygame
pygame.module
What is the purpose of the game loop in a Pygame application?
To pause the game and display a game over message.
To randomly generate game elements and obstacles.
To display the game instructions and rules.
To continuously update the game state, handle user input, and redraw the screen.
Which function is used to update the display in Pygame?
pygame.display.render()
pygame.display.refresh()
pygame.display.update()
pygame.display.flip()
What is the correct syntax to create a Pygame window with a width of 800 and height of 600?
pygame.display.set_mode((600, 800))
pygame.display.set_mode(800, 600)
pygame.display.set_mode(800, 600, 0)
pygame.display.set_mode((800, 600))
Which module is used to handle keyboard and mouse events in Pygame?
pygame.event
pygame.controls
pygame.interact
pygame.input
What is the purpose of the pygame.sprite module in Pygame?
The pygame.sprite module in Pygame is used for rendering graphics in a game.
The pygame.sprite module in Pygame is used for handling user input in a game.
The pygame.sprite module in Pygame is used for handling audio in a game.
The purpose of the pygame.sprite module in Pygame is to create and manage sprites in a game.
Which function is used to quit the Pygame application?
pygame.exit()
pygame.close()
pygame.quit()
pygame.stop()
Как называется библиотека (модуль), которая позволяет разрабатывать игры на Python
(a)
Какую функцию нужно использовать в начале программы, чтобы запустить pygame?
pygame.init()
pygame.__init__()
__init__()
pygame()
Как создать экран с определенным размером?
pygame.screen(400, 400)
pygame.display.set_mode((400, 400))
screen = pygame.screen()
screen.size((400, 400))
pygame.display.size((400, 400))
Как создать прямоугольник?
pygame.Rect(50, 50, 100, 200)
pygame.Rectangle(50, 50, 100, 200)
pygame.Pryamougolnik(50, 50, 100, 200)
pygame.Sqrt(50, 50, 100, 200)
Как создать бесконечный цикл?
while True:
while False:
while beskonecho:
for i in True:
Какие точки нужно указать для создания прямоугольника с помощью функции Rect()?
Верхняя левая
Верхняя правая
Нижняя левая
Нижняя правая
for event in pygame.event.get():
Для чего используется данный цикл?
Для обработки событий
Для начала игры
Для отрисовки изображений
Такой цикл в pygame не используется
Как нарисовать прямоугольник?
pygame.draw.rect(screen, color, r, 10)
pygame.draw.line(screen, сщдщк, (100, 100), (200, 200), 10)
pygame.draw.circle(screen, color, (200, 300), 30)
pygame.draw.ellipse(screen, color, rect, 1)
Как нарисовать линию?
pygame.draw.rect(screen, color, r, 10)
pygame.draw.line(screen, сщдщк, (100, 100), (200, 200), 10)
pygame.draw.circle(screen, color, (200, 300), 30)
pygame.draw.ellipse(screen, color, rect, 1)
Как нарисовать эллипс?
pygame.draw.rect(screen, color, r, 10)
pygame.draw.line(screen, сщдщк, (100, 100), (200, 200), 10)
pygame.draw.circle(screen, color, (200, 300), 30)
pygame.draw.ellipse(screen, color, rect, 1)
Как выбрать цвет из готового набора цветов pygame?
(a)
print("Hello world!")
print(3+4)
What would this print?
print("3+4")
Print("Hello world!")
print("Hello" + "world" + "today")
print(Hello world!)
print(9/3)
Which of the following is a command to have a message appear on the screen?
write
msg
input
Pick the Python command used to let the user type in some data
get
input
int
float
Which of the following is a Python command word used to indicate we want to work with WHOLE numbers
input
int
float
Which of the following is a Python command word used to indicate we want to work with DECIMAL numbers
input
int
float
Which of the following is a Python command word used to indicate we want to set up a fixed loop
while
next
for
What would be printed by the command
print('12-5')
12-5
'12-5'
7
'7'
print(Hello world!)
Which of the following is used in Python to give a value to a variable
:=
==
=
How do you insert COMMENTS in Python code?
/*this is a comment
//this is a comment
#this is a comment
