TORONTO KIDS COMPUTER CLUB | Wednesday Friday 15:00 Python Practice 20.09.02.
post-template-default,single,single-post,postid-18244,single-format-standard,ajax_fade,page_not_loaded,,no_animation_on_touch,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Wednesday Friday 15:00 Python Practice 20.09.02.

03 Sep Wednesday Friday 15:00 Python Practice 20.09.02.

Roy was trying to record all the money he spend in the trip in the United States. He recorded every USD(U.S. Dollar) expenses in the trip. However he wants to convert every record into CAD(Canadian Dollar) using certain exchange rate. Please write a program using the split and join knowledge to convert all the USD into CAD.

Input Specification:
First line contains all the USD records, every record end with USD and separate by space.

Second line is the exchange rate for example: 1.33 means 1 USD = 1.33CAD

Output Specification:
Show all the records as CAD, round to 2 digits after the decimal point. round(number, ndigits) will help you to round the number to the ndigits after the decimal point.

Sample Input:
2.5USD 3.4USD 12.84USD 30.3USD 107.6USD 2.4USD

Sample Output:
3.33CAD 4.52CAD 17.08CAD 40.30CAD 143.11CAD 3.19CAD

No Comments

Post A Comment