⬆️ ⬇️

Problem solved. But is the code good?

I teach web technologies at VolgGTU.

See earlier: ( Course structure , Design , HTML , All lectures ).



We study html + css + we write laboratory using LAMP.

I do not insist on using PHP, although I consider it to be one of the most common and popular development tools.



My student, Cyril Kindyuk, expressed a desire to write 3 LR in Python. Since there is not a single pronounced flaw in this language (well, except perhaps in addition to difficulties with free hosting), I have allowed.



Task:
Assignment for 3 LR:

Given the text. It is necessary to find in it all amounts in different currencies and transfer to rubles.

Input data: text, rate and designation of each currency.

For simplicity, assume that all amounts are in the form of {NUMBER} {CURRENCY}, that is, "$ 113" or "278.6 rubles."

Any currency symbols are allowed. If the currency designation met without a number, do not translate.

Step 1. Enter the number of currencies and text

Step 2. Entering the exchange rate for the ruble and the designation of each currency

Step 3. Text output


Problem solved: Reference , Code .

')

I don't understand the code and programming techniques in Python so much to evaluate the quality of the solution. I will correct, but for now I ask the experts to evaluate the decision of Cyril.



Thanks for attention.

Source: https://habr.com/ru/post/45880/



All Articles