Не могу понять, почему при запуске кода пишет "invalid syntax" ведь в коде нет опечаток
Не могу понять, почему при запуске кода пишет "invalid syntax" при этом ссылаясь на 45 (предпоследняя) строку (код из 45 строки: pygame.quit() ), ведь в коде нет опечаток.
Код:
import pygame
# создаем экран
pygame.init()
screen = pygame.display.set_mode((640, 480)).fill((white))
pygame.display.update()
pygame.display.set_caption("Random dice")
#цвета
aqua = ( 0, 255, 255) # морская волна
black = ( 0, 0, 0) # черный
blue = ( 0, 0, 255) # синий
fuchsia = (255, 0, 255) # фуксия
gray = (128, 128, 128) # серый
green = ( 0, 128, 0) # зеленый
lime = ( 0, 255, 0) # цвет лайма
maroon = (128, 0, 0) # темно-бордовый
navy_blue = ( 0, 0, 128) # темно-синий
olive = (128, 128, 0) # оливковый
purple = (128, 0, 128) # фиолетовый
red = (255, 0, 0) # красный
silver = (192, 192, 192) # серебряный
teal = ( 0, 128, 128) # зелено-голубой
white = (255, 255, 255) # белый
yellow = (255, 255, 0) # желтый
#print text
pygame.font.init()
myfont = pygame.font.SysFont('Comic Sans MS', 30)
fontObj = pygame.font.Font('freesansbold.ttf', 50)
textSurfaceObj = fontObj.render('Hello world!', True, yellow, blue)
textRectObj = textSurfaceObj.get_rect()
textRectObj.center = (500, 400)
screen.fill(white)
screen.blit(textSurfaceObj, textRectObj
#start loop
game_end = False
while not game_end:
#game loop
for event in pygame.event.get():
if event.type == pygame.QUIT:
game_end = True
pygame.quit()
quit()
Ответы (1 шт):
Автор решения: Victor VosMottor
→ Ссылка
Забыли закрыть скобку в конце этой строки:
screen.blit(textSurfaceObj, textRectObj