Blog | luminousmen

I P
Back

Optional arguments MUST use keywords (Python3)

Imagine that you are developing software for the big shipping company(why would you imagine small anyway). And you got a task to create a function for calculating a charge for ships based on their cargo weight. Easy breezy: WEIGHT_RATES = [ ( 10, 10.55), ( 5, 5.05), ( 2, 3.35), ( 0, 1.25) ] def...