Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61320

Re: python programming help

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'argument': 0.05; 'subject:help': 0.08; 'lawrence': 0.09; 'lines:': 0.09; 'prevents': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'typed': 0.09; 'def': 0.12; 'wrote': 0.14; 'language.': 0.14; 'newlines': 0.16; 'none.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'statement.': 0.16; 'subject:programming': 0.16; 'typeerror:': 0.16; 'subject:python': 0.16; 'language': 0.16; 'wrote:': 0.18; 'pointed': 0.19; 'print': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'url:moin': 0.24; 'question': 0.24; 'skip:" 40': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'returned': 0.30; 'lines': 0.31; 'url:wiki': 0.31; 'asks': 0.31; 'file': 0.32; 'says': 0.33; 'url:python': 0.33; 'running': 0.33; '(most': 0.33; 'test': 0.35; 'but': 0.35; 'thanks': 0.36; 'url:org': 0.36; 'to:addr:python- list': 0.38; 'recent': 0.39; 'extremely': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'numbers': 0.61; "you've": 0.63; 'email addr:gmail.com': 0.63; 'name': 0.63; 'our': 0.64; 'different': 0.65; 'charset:windows-1252': 0.65; 'default': 0.69; 'cut': 0.74; 'dic': 0.84; 'seriously,': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: python programming help
Date Sun, 08 Dec 2013 19:21:22 +0000
References <264c1144-5d04-4ad0-aa32-f4e6770d210c@googlegroups.com> <mailman.3733.1386527267.18130.python-list@python.org> <2243d31b-f2cb-484a-b6a3-f9f265aa8fd6@googlegroups.com> <mailman.3737.1386529135.18130.python-list@python.org> <78e2bedb-edcb-47ab-a89d-b62d60611481@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host host-78-147-26-110.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
In-Reply-To <78e2bedb-edcb-47ab-a89d-b62d60611481@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3740.1386530507.18130.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1386530507 news.xs4all.nl 2862 [2001:888:2000:d::a6]:48083
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:61320

Show key headers only | View raw


On 08/12/2013 19:06, rafaellasav@gmail.com wrote:
> i get it, thanks a lot i wrote a different one and it works
>
> def people(age):
>      people=[name for name in dic if dic[name]==age]
>      print(people)
>
> people(20)
>
> i have one last question
>
> it asks me to test my program function by running these lines:
> print ’Dan’ in people(18) and ’Cathy’ in people(18)
> print ’Ed’ in people(19) and ’Helen’ in people(19) and\
> ’Irene’ in people(19) and ’Jack’ in people(19) and ’Larry’in
> people(19)
> print ’Alice’ in people(20) and ’Frank’ in people(20) and ’Gary’ in
> people(20)
> print people(21) == [’Bob’]
> print people(22) == [’Kelly’]
> print people(23) == []
>
> but when i wrote these lines it returns me an error
> Traceback (most recent call last):
>    File "/Users/rafaellasavva/Desktop/people.py", line 19, in <module>
>      print 'Dan' in people(18) and 'Cathy' in people(18)
> TypeError: argument of type 'NoneType' is not utterable
>
> do you know what it might be wrong?
>

You've typed up the error message instead of using cut and paste, which 
is why it says "utterable" instead of "iterable"? :)  Seriously, it's 
already been pointed out that your people function needs a return 
statement.  Without it, the default returned is always None.

Would you also please read and action this
https://wiki.python.org/moin/GoogleGroupsPython as it prevents us seeing 
huge numbers of unwanted newlines which some find extremely irritating.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

python programming help rafaellasav@gmail.com - 2013-12-08 09:59 -0800
  Re: python programming help YBM <ybmess@nooos.fr.invalid> - 2013-12-08 19:07 +0100
    Re: python programming help rafaellasav@gmail.com - 2013-12-08 10:14 -0800
      Re: python programming help YBM <ybmess@nooos.fr.invalid> - 2013-12-08 19:18 +0100
      Re: python programming help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-08 18:25 +0000
      Re: python programming help Christopher Welborn <cjwelborn@live.com> - 2013-12-09 17:34 -0600
  Re: python programming help Roy Smith <roy@panix.com> - 2013-12-08 13:23 -0500
  Re: python programming help Gary Herron <gary.herron@islandtraining.com> - 2013-12-08 10:20 -0800
  Re: python programming help bob gailer <bgailer@gmail.com> - 2013-12-08 13:27 -0500
    Re: python programming help rafaellasav@gmail.com - 2013-12-08 10:32 -0800
      Re: python programming help rafaellasav@gmail.com - 2013-12-08 10:42 -0800
      Re: python programming help Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-12-08 10:52 -0800
        Re: python programming help rafaellasav@gmail.com - 2013-12-08 11:06 -0800
          Re: python programming help Chris Angelico <rosuav@gmail.com> - 2013-12-09 06:17 +1100
            Re: python programming help rurpy@yahoo.com - 2013-12-08 16:08 -0800
              Re: python programming help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-09 00:27 +0000
                Re: python programming help rurpy@yahoo.com - 2013-12-08 21:07 -0800
                Re: python programming help rusi <rustompmody@gmail.com> - 2013-12-08 21:20 -0800
                Re: python programming help rurpy@yahoo.com - 2013-12-09 21:15 -0800
                Re: python programming help Chris Angelico <rosuav@gmail.com> - 2013-12-09 18:57 +1100
                Re: python programming help rurpy@yahoo.com - 2013-12-09 21:07 -0800
                Re: python programming help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-09 09:34 +0000
                Meta Fight About Posting (was: python programming help) Travis Griggs <travisgriggs@gmail.com> - 2013-12-09 07:44 -0800
                Re: Meta Fight About Posting (was: python programming help) rusi <rustompmody@gmail.com> - 2013-12-09 08:25 -0800
                Re: Meta Fight About Posting (was: python programming help) rusi <rustompmody@gmail.com> - 2013-12-09 08:47 -0800
                Re: Meta Fight About Posting (was: python programming help) Roy Smith <roy@panix.com> - 2013-12-09 13:48 -0500
                Re: Meta Fight About Posting (was: python programming help) Roy Smith <roy@panix.com> - 2013-12-09 13:45 -0500
              Re: python programming help Chris Angelico <rosuav@gmail.com> - 2013-12-09 14:05 +1100
                Re: python programming help rurpy@yahoo.com - 2013-12-08 21:10 -0800
                Re: python programming help Joel Goldstick <joel.goldstick@gmail.com> - 2013-12-09 00:22 -0500
                Re: python programming help Chris Angelico <rosuav@gmail.com> - 2013-12-09 19:15 +1100
                Re: python programming help rurpy@yahoo.com - 2013-12-09 21:10 -0800
                Re: python programming help Chris Angelico <rosuav@gmail.com> - 2013-12-10 16:29 +1100
          Re: python programming help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-08 19:21 +0000
          Re: python programming help Terry Reedy <tjreedy@udel.edu> - 2013-12-08 16:17 -0500
          Re: python programming help YBM <ybmess@nooos.fr.invalid> - 2013-12-09 03:02 +0100
      Re: python programming help John Ladasky <john_ladasky@sbcglobal.net> - 2013-12-08 11:21 -0800
      Re: python programming help Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-09 13:00 +1300
        Re: python programming help YBM <ybmess@nooos.fr.invalid> - 2013-12-09 02:51 +0100
      Re: python programming help YBM <ybmess@nooos.fr.invalid> - 2013-12-09 03:31 +0100

csiph-web