404 Posted Topics
Re: I liked your recursive anagram creator, but it is expensive because it generates n! strings for a size n scramble. I tested it with [code]print anagrams("Hi There")[/code] and my reasonably fast machine cried and locked up. :lol: Another possibility would be to test whether your scramble is an anagram for … | |
Re: OK, why did you have [inlinecode]entry1.bind('<Return>', func=lambda e:checkAnswer()) [/inlinecode] instead of [inlinecode]entry1.bind('<Return>', func=checkAnswer)[/inlinecode]? Thanks, Jeff Cagle | |
In brief, I'm trying to get a 'virtual class' thing going so that I can use it for generic Toplevel widgets whose behavior is specified by the inheriting class. I have this code (Pyth. 2.4): [code] class Generic: def __init__(self): self.field = "hi" # placeholder def gen_method(self): self.method() # I'm … | |
Re: I'm a Python newbie, but I'll take a stab: The string methods like lower(), isdigit(), etc. all assume that the sequence consists of single characters. I think of a tuple as a string where each 'character' could be literally any object whatsoever. What would it mean to have a function … |
The End.