0
Problem on the Python course
There is a practice for lambda functions, where i need to write a code that counts a percentage of a number. But, even though i wrote the function right and AI says so, there is a 1 hidden task that is not passed. I don't know if it's a sololearn error or me who's inattentive. (lambda x,y:(x/100)*y)(price, perc)
5 Answers
+ 8
Đdilet Isakov ,
Rearrange the calculation to help avoid tiny floating-point rounding errors. Divide last.
(lambda x, y: x*y/100)(price, percentage)
+ 3
Hi! Exact were have you found this task? Is the code above all code to solve the problem, or is it just a bit of it?
You need two inputs, and convert the inputs to integers. You also have to print your result (your code line above).
+ 1
Rain thank you, it worked!
+ 1
Per Bratthammar thank you too!
+ 1
Rain
yes, very interesting.
https://code.sololearn.com/cG3t8h1F2moY/?ref=app