Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #55109
| Date | 2013-09-30 21:08 +0100 |
|---|---|
| From | MRAB <python@mrabarnett.plus.com> |
| Subject | Re: Python Unit Tests |
| References | <bb6482de-ce4e-4dd2-845c-f71008123c03@googlegroups.com> <64c1fa97-ace1-4fee-83b0-cf5fd7230e82@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.503.1380571692.18130.python-list@python.org> (permalink) |
On 30/09/2013 20:54, melwin9@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?
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python Unit Tests melwin9@gmail.com - 2013-09-27 21:52 -0700
Re: Python Unit Tests Dave Angel <davea@davea.name> - 2013-09-28 06:11 +0000
Re: Python Unit Tests Terry Reedy <tjreedy@udel.edu> - 2013-09-28 14:47 -0400
Re: Python Unit Tests melwin9@gmail.com - 2013-09-29 18:46 -0700
Re: Python Unit Tests Steven D'Aprano <steve@pearwood.info> - 2013-09-30 02:55 +0000
Re: Python Unit Tests melwin9@gmail.com - 2013-09-29 21:19 -0700
Re: Python Unit Tests Terry Reedy <tjreedy@udel.edu> - 2013-09-30 02:08 -0400
Re: Python Unit Tests melwin9@gmail.com - 2013-09-30 12:54 -0700
Re: Python Unit Tests MRAB <python@mrabarnett.plus.com> - 2013-09-30 21:08 +0100
Re: Python Unit Tests Dave Angel <davea@davea.name> - 2013-09-30 20:20 +0000
Re: Python Unit Tests Terry Reedy <tjreedy@udel.edu> - 2013-09-30 20:06 -0400
csiph-web