Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

import pygame,svs pygane.init() a = input(\"Please enter the filename of the bac

ID: 3722715 • Letter: I

Question

import pygame,svs pygane.init() a = input("Please enter the filename of the background image:") b pygane.inage.load(a) (width, height) = b.get_rect().size background display = pygane.display . Set mode((width, helght)) background pygame.inage.load (a).convert() background displav.blit(background, (o, 0)) pygane.display.update() cint(input("how many ninjas (1-8) that you want added:")) =True while C: if c=-1: d = pygame.inage.load(ninja_image-01.bmp) (width1. height!) = d.get ect(). Size display = pygame . display. Set mode((width1. height!)) displaynew = d.set_at((width1, height!), (0, 231, 26)) y = pyga e.inage . load(ninja_inage-01.b p).convert() background.blit(y, (0, 0)) pygane.display.update()

Explanation / Answer

because name of the bmp file ninja_image_01.bmp is string type and you havent define yet , i can see earlier you save that value in variable a so two quick fixes :

you can pass the var a that store the value as string of file

pygame.image.load(a)

or pass the name of file as string means in double quote

pygame.image.load('ninja_image_01.bmp')

applied for all places where you want the file.

Thanks.

Please do let me know if u have any concern....