Forwarding to the list since I wasn't the only person who helped ;) Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- From: ADRIAN KELLY [mailto:kellyadr...@hotmail.com] Sent: Thursday, November 17, 2011 6:08 PM To: Prasad, Ramit Subject: RE: [Tutor] urgent help!! THANKS EVERYONE! Thanks for your help i just got it going my way below - but your way looks easier and better! thanks for all your help everyone. feel free to comment on my method - its awkward but it works.......... adrian def exchange(cash_in): euro=1 dollar=1.35 base=50 if cash_in>base: totalreturn=cash_in*dollar else: totalreturn=0 return totalreturn def main(): amount=0 amount = float(raw_input('how much do you want to change:')) while amount<50: print 'enter an amount over 50' amount = float(raw_input('how much do you want to change:')) else: total=exchange(amount) print 'Your exchange comes to: ',total main() > From: ramit.pra...@jpmorgan.com > To: kellyadr...@hotmail.com; waynejwer...@gmail.com > CC: tutor@python.org > Subject: RE: [Tutor] urgent help!!!!!!!!!!! > Date: Thu, 17 Nov 2011 23:43:10 +0000 > > def exchange(cash_in): > euro=1 > dollar=1.35 > base=50 > if cash_in>base: > totalreturn=cash_in*dollar > else: > totalreturn=0 > return totalreturn > > amount=0 > # this would be better placed inside the main function. > def main(): > while amount<50: > amount = raw_input(float('how much do you want to change:')) > # This should be > # amount = float( raw_input('how much do you want to change:' ) ) > if amount<50: > total=0 > print 'enter an amount over 50: ' > else: > total=exchange(amount) > print 'Your exchange comes to: ',total > > > Ramit > > > Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology > 712 Main Street | Houston, TX 77002 > work phone: 713 - 216 - 5423 > > -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor