So I am getting into the swing of python in my class, and am currently trying to take a program from an example, and making it much more condensed. The issue I am having, is there are many classes for a tkinter guessing game.
def question5(): if entry5.get() in ["Samus", "samus", "Metroid", "metroid", "Prime", "prime", "Metroid Prime", "metroid prime"]: answerlabel5['text']= "Its the amazing Metroid game heroine Samus, good call!" else: answerlabel5['text']= "Sigh.. try again." def question(butnum): print "calling proc" #shows space in output to see what is going in print "you submitted", butnum #trying to find what output is happening. """if (ent[i]).get() in ans[i]: (a[i])['text'] = acor[i] else: (a[i])['text'] = ahint[i]""" #" was an attempt to get it to work. for i in range(0, 5): images[i] = Label(image=images[i]).pack() ent[i] = Entry().pack() sub[i] = Button(text="Submit Answer",command=(lambda: question('i')), fg="white",bg="grey50", font=('impact',10)).pack() ans[i] = Label(text="", bg="white", font=('impact',10)).pack()
The class question 5 is one of 5(obviously) that checks for a right answer. I was trying to make a class that would dynamically check based on what entry box I was entering into. How would I get that to work with the class, or is it even possible?