Ahojte, som na začiatku programovania v Pythone. Došiel som zatiaľ po podmienku IF a nejde mi tento jednoduchý program. V čom robím chybu?
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
import tkinter, random
canvas = tkinter.Canvas(bg='white', width=300, height=300)
canvas.pack()
for i in range(1000):
x = random.randrange(300)
y = random.randrange(300)
if x < 150:
farba = 'red'
else:
farba = 'blue'
canvas.create_oval(x-5, y-5, x+5, y+5, fill = farba, outline'')