import pygame
from pygame.locals import *
from sys import exit
from random import *
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
while True:
for event in pygame.event.get():
if event.type == QUIT:
exit()
screen.lock()
for count in range(10):
random_color = (randint(0, 255), randint(0, 255), randint(0, 255))
random_pos = (randint(0, 639), randint(0, 479))
random_size = (639-randint(random_pos[0], 639), 479-randint(random_pos[1], 479))
pygame.draw.rect(screen, random_color, Rect(random_pos, random_size))
screen.unlock()
pygame.display.update()
In the above code, why are the three lines following the second for loop encased in parentheses? And what is the last of those three lines.(639-randint? How did they just slap a number and a dash right in front of a function. Thanks for any and all replies.
On a side note, why doesn't python support function, method, and constructor overloading? And what does it do to compensate?