Re: help

Discussion in 'Python' started by Matt Jones, Jan 11, 2013.

  1. Matt Jones

    Matt Jones Guest

    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, <> 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
    >
    >
     
    Matt Jones, Jan 11, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    806
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    777
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    892
    Daniel
    Jul 16, 2004
  4. =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=

    HELP - HELP - HELP

    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    718
    Eliyahu Goldin
    Mar 9, 2006
  5. Buster

    Help, Help, Help

    Buster, Oct 4, 2003, in forum: Java
    Replies:
    3
    Views:
    495
    Saager
    Oct 30, 2003
Loading...

Share This Page