Python Unit Tests

MRAB python at mrabarnett.plus.com
Mon Sep 30 16:08:16 EDT 2013


On 30/09/2013 20:54, 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
>
[snip]
Look at 'getguess'.

If the user guess correctly within the number of allowed attempts, the
function returns (guess, tries), but what if the user runs out of
attempts?




More information about the Python-list mailing list