Python Unit Tests

Terry Reedy tjreedy at udel.edu
Mon Sep 30 20:06:26 EDT 2013


On 9/30/2013 3:54 PM, melwin9 at gmail.com wrote:
> Lol, im starting to get the hang out of, onto the next hurdle, i looked up the error and it says the data is none?
>
> Traceback (most recent call last):
>    File "guess.py", line 34, in <module>
>      main(random.randint(1, 10))
>    File "guess.py", line 27, in main
>      guess, tries = getguess(target, allowed)
> TypeError: 'NoneType' object is not iterable

If you have not figured it out yet, add a copy of the return within the 
while loop,
    return guess, tries
after the while loop also, so it does not return the default of None.

-- 
Terry Jan Reedy




More information about the Python-list mailing list