import pygame import sys pygame.init() display = pygame.display.set_mode((300,300)) display.fill((255,255,255)) # Drawing a line on the display surface using Pygame's draw.line() function. pygame.draw.line(display, (0,0,255), (10,10), (100,100), width=2) # display: The surface to draw the line on. # (0, 0, 255): The color of the line in RGB format, here it represents blue color. # (10, 10): The starting point of the line, represented as (x, y) coordinates. # (100, 100): The ending point of the line, represented as (x, y) coordinates. # width=2: The width of the line. Here, it's set to 2 pixels, making the line thicker. while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() pygame.display.update()