SyntaxFix
Write A Post
Hire A Developer
Questions
Very quickly and sortly-code implementation by using the lambda operator.
In [17]: percent = lambda part, whole:float(whole) / 100 * float(part) In [18]: percent(5,400) Out[18]: 20.0 In [19]: percent(5,435) Out[19]: 21.75