[Tutor] program for a problem
Dwight Hutto
dwightdhutto at gmail.com
Wed Oct 17 23:34:37 CEST 2012
On Mon, Oct 8, 2012 at 11:55 AM, Tharuni Dheeraj
<tharunichowdary at gmail.com> wrote:
> please send me the program for the following que:
>
> Write a program that asks the user for a dollar amount.It then reports the
> corresponding number of euros by using the current exchange rate.
> --
> Regards,
> Tharuni Dheeraj
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
How many euros do I get paid for this?
import urllib
usd_dollar_amount = raw_input(" Enter USD dollar amount: $")
exchange_rate =
urllib.URLopener().open("http://path_to_url_where_data_is_exracted_from.html")
for line in exchange_rate:
if line == line_where_usd_eur_conversion_is_listed:
if eur < usd:
amount_to_account_for = (1 - eur_current_value) * usd_dollar_amount
amount_of_conversion = usd_dollar_amount - amount_to_account_for
print amount_of_conversion
--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
More information about the Tutor
mailing list