DEV Community

Discussion on: Daily Challenge #64- Drying Potatoes

Collapse
 
aadibajpai profile image
Aadi Bajpai • Edited

Good ol' python one-liner* 😊

def potatoes(p0, w0, p1): return w0*(100-p0)/(100-p1)

>>> potatoes(99, 100, 98)
50

*math sold separately

Collapse
 
devparkk profile image
Dev Prakash

I didn't know that we can define a function and return it in the same line ...
That's crazy