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


Groups > comp.lang.python > #36624

Re: help

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <matt.walker.jones@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.058
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; '(at': 0.03; 'subject:help': 0.07; 'cc:addr:python-list': 0.10; '"your': 0.16; '&quot;your': 0.16; 'example).': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'jan': 0.18; 'email addr:gmail.com&gt;': 0.20; 'cc:2**0': 0.23; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'dictionary': 0.29; 'url:mailman': 0.29; 'skip:& 10': 0.29; 'code': 0.31; 'url:python': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'serve': 0.36; 'url:org': 0.36; 'two': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'url:mail': 0.40; 'your': 0.60; 'different': 0.63; 'show': 0.63; 'six': 0.65; 'money': 0.74; '2013': 0.84; '[name]': 0.84; 'url:bt': 0.84; 'url:people': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=62XKDqKY7jcSNPLeXVlHeIbNYPPdCB9u+ZBrRyREPtg=; b=HrndMdmk67/iuu2bp1C6/X6uN2Tu24tt4wctqu2dA1b8a/hKQUm66iKcoTG/xePZdG FrI9bakd6dYdJkJ7Evx8FixIPOTm3AkZz3Hw1f7nLdN51Ry/nTOr/v7HSX4HFk6iSjev QDM6aVfLn9LePvB98T/YDmFKIwV1rRZgRnorJ6INyGHZwDdQvJs98R2lfc4b8tRMmEEe VDowCdXa4wvKtzZbWxQBE14ko/j4H9lqBWJ3Xdz0Zt9UVg0WIogIdijPkO1LED92SjF/ fNMmXwtC+0XOOhi8csr+UJ2l+JadKn6Yvs2JOYB2uQglaaCdPydiJwKvhfD0LvMzsoxn meiw==
MIME-Version 1.0
In-Reply-To <07AEBD8B16FA4C03A16257998C995B38@favour>
References <07AEBD8B16FA4C03A16257998C995B38@favour>
From Matt Jones <matt.walker.jones@gmail.com>
Date Fri, 11 Jan 2013 08:24:41 -0600
Subject Re: help
To kwakukwatiah@gmail.com
Content-Type multipart/alternative; boundary=e89a8ff1c56a93aec904d3040f28
Cc "python-list@python.org" <python-list@python.org>
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.399.1357914311.2939.python-list@python.org> (permalink)
Lines 94
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357914311 news.xs4all.nl 6920 [2001:888:2000:d::a6]:55236
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36624

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Pay isn't linked to the "people" in any way.  A dictionary would serve this
purpose better (at least in this simple example).

database = {
    'Mac' : 1000,
    'Sam' : 2000
}

name = raw_input('Enter your name:')
if name in database.keys(): print "your pay is $", database[name]

*Matt Jones*


On Thu, Jan 10, 2013 at 12:35 PM, <kwakukwatiah@gmail.com> wrote:

>   pls this is a code to show the pay of two people.bt I want each of to
> be able to get a different money when they enter their user name,and to use
> it for about six people.
> database = [
>     ['Mac'],
>     ['Sam'],
>     ]
> pay1 = 1000
> pay2 = 2000
>
> name = raw_input('Enter your name: ')
> if [name] in database:print "your pay is $",pay
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>

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


Thread

Re: help Matt Jones <matt.walker.jones@gmail.com> - 2013-01-11 08:24 -0600

csiph-web