[Tutor] python help.. dictionary.
chronolee24 at hotmail.com
Mon Apr 5 19:06:00 EDT 2004
hello .. i'm new too python.. and programming..and learning slowly...
i'm creating a bank teller program. It has a list and dictionary.
It askes for the user's input (raw_input) asking for an amount. If the user
enters letters instead of an amount it would count it as 'counterfiet'.
Would i have to write a for loop function? how would i compare to see if it
is a string or an interger?..and i can't figure out how to work it with the
dictionary.. like if i put in $30.25.. it would return "you have 1 $20 bill,
1 ten, and 1 quarter" .. i'm so frustrated.
here's what i have so far..
wallet=raw_input("money in wallet ")
for i in conterfeit(x):
I want the program to output something like this...It should report the
total value of the legal money as a floating point value (e.g. 123.45) and
the total number of counterfeit pieces received.
Money in wallet: asdfasdf
Contained "1" counterfiet piece(s).
Total amount in bank $20.00
asking for any help? thanks a lot..
Watch LIVE baseball games on your computer with MLB.TV, included with MSN
More information about the Tutor