3# Ask the user for an amount in dollars to convert
4amount = float(raw_input('How much money do you want to convert? '))
5if not 100 <= amount <= 1000:
6 print 'The amount to exchange should be between 100 and 1000; you entered %f' % amount
9# Ask the user for the code for the country they want
10destination_currency = raw_input('Which currency do you want to receive? ')
12plural_currency = destination_currency + 's'
14rate = float(raw_input('What is the exchange rate (1 USD = ? ' + plural_currency + ') '))
15if rate <= 0:
16 print 'The exchange rate should be a positive value; you entered %f' % rate
19direction = raw_input('Are you exchanging from US dollars, or to US dollars: ')
20if direction == 'from':
21 print amount, 'US dollars is', amount*rate, plural_currency
23 print amount, plural_currency, 'is', amount/rate, 'US dollars'