Dobrý deň, dostal som za úlohu naprogramovať v Pythone toto:
pracujem na tom už niekoľko hodín a stále mi neukáže to, čo má. Buď mi ukáže v shelli vypísané červenou chyby alebo program nezareaguje. Preto by som poprosil o pomoc. Ďakujem. :)
úloha: Upravte program tak, aby sa postupnosť vždy kreslila od ľavého okraja obrazovky.
import tkinter
from random import *
canvas = tkinter.Canvas()
canvas.pack()
def stvorcek(x, y, info):
canvas.create_rectangle(x-10, y-10, x+10, y+10)
canvas.create_text(x, y, text=info)
def button1_klik():
od = int(entry1.get())
do = int(entry2.get())
for i in range (od, do):
stvorcek(i*20, 100, i)
button1 = tkinter.Button(text='postupnosť', command=button1_klik)
button1.pack()
entry1 = tkinter.Entry()
entry1.pack()
entry2 = tkinter.Entry()
entry2.pack()
Are you looking for informatika tutoring? Find the right informatika tutor for online or in-person tutoring near you.
We access the information stored on your device for this website to function properly. This includes, for example, cookies or local browser cache. We use this to store the data necessary for the functioning of the website, data used for analytical purposes, or data stored by third parties.
If this information is essential for the operation of this website, we store it automatically. For everything else, we need your consent, which you can choose to give below. Your consent is valid for 12 months. Should you refuse, we will ask you for consent again in 6 months, but you are free to change your mind at any time. For more information, please see our GDPR and Terms of Use.