help
Matt Jones
matt.walker.jones at gmail.com
Fri Jan 11 09:24:41 EST 2013
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 at 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130111/c404a66a/attachment.html>
More information about the Python-list
mailing list