import pygame import sys pygame.init() displaysurface = pygame.display.set_mode((400,300)) pygame.display.set_caption("Task3") obj1 = pygame.Rect((20, 50), (50, 100)) obj2 = pygame.Rect((10, 10), (100, 100)) print(obj1.topleft) print(obj2.topleft) obj3 = pygame.Rect((0, 0), (50, 50)) obj4 = pygame.Rect((100, 100), (30, 50)) list = [obj2, obj3, obj4] print(obj1.colliderect(list)) while True: events = pygame.event.get() for event in events: if event.type == pygame.QUIT: pygame.quit() sys.exit() pygame.display.update()