خرید بک لینک

Vote count: 0

Just wanted to create a random rectangle on my rectangle Class(): so I have a function def randomRects(x,y,width,height): x,y are top left coordinates and width must be less than 90, height less than 70. This is what i have done so far, i understand to create a random rectangle you have to do something like canvas.create_rectangle(x1,x2,y1,y1) just not sure how to do it in this situation .

import random

class Rectangle:

def __init__(self, height, width):
    self.height = 80
    self.width = 100
 #not sure if above is correct

def randomRects(x,y,width, height):
    for i in .....:
        w = random.randrange(100)
        h = random.randrange(80) 

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 1 ارديبهشت 1395 ساعت: 7:15

صفحه بندی