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

Wednesday Friday 15:00 Python Practice 20.09.02.

03 Sep Wednesday Friday 15:00 Python Practice 20.09.02.

Question:
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
1.33

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

1Comment
  • Jesse Shi
    Posted at 03:26h, 04 September Reply

    print(‘Tell me how much he have wasted on that trip, I want clearly for each day!’)
    USD1 = int(input(‘1: ‘))
    USD2 = int(input(‘2: ‘))
    USD3 = int(input(‘3: ‘))
    USD4 = int(input(‘4: ‘))
    USD5 = int(input(‘5: ‘))

    print(‘Ok that is ‘, USD1 * 1.33, USD2 * 1.33, USD3 * 1.33, USD4 * 1.33, USD5 * 1.33,’in total, do you want to pay by master or critic card?’)

Post A Comment