Coursera Courses Answers. 100% correct answers guaranteed. Covered every possible question for free.

Search This Blog

Breaking

Friday, 24 July 2020

1. Create Your First Game with Python

Create Your First Game with Python

by Coursera Project Network

Graded Quiz Answers :

1.Question 1

Given the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pygame
from pygame import display, image, event
pygame.init()
display.set_caption('My Game')
screen = display.set_mode((128, 128))
some_image = image.load('some_image.png')
screen.blit(some_image, (10, 10))
running True
while running:
for e in event.get():
if e.type == pygame.QUIT:
running = False

Select all that are true:

1 / 1 point

2.Question 2

Assuming the image some_image.png which is 128 pixels wide and 128 pixels high, and given the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pygame
from pygame import display, image, event
pygame.init()
display.set_caption('My Game')
screen = display.set_mode((128, 128))
some_image = image.load('some_image.png')
some_image = transform.scale(some_image, (64, 64))
other_image = some_image.copy()
other_image.fill((255, 255, 255))
screen.blit(some_image, (0, 0))
screen.blit(other_image, (64, 64))
running True
while running:
for e in event.get():
if e.type == pygame.QUIT:
running = False

Select all statements that are true:

1 / 1 point

3.Question 3

The function "flip" on the PyGame module "display" is used to ______________

1 / 1 point

4.Question 4

The function "get" on the PyGame module "event" is used to ________________

1 / 1 point

5.Question 5

What does the following code do?

1
2
3
4
for e in pygame.event.get():
if e.type == pygame.MOUSEBUTTONDOWN:
x, y = pygame.mouse.get_pos()
print(x y)

1 / 1 point

No comments:

Post a Comment

If you have any doubts, please let me know.