Topic:
The bonuses awarded by the Enterprise are based on the profit percentage. Profit (I) less than or equal to $100,000, the bonus can be raised by 10%, the profit is higher than $100,000, less than $200,000, less than 100,000 of the portion of the 10% commission, higher than the portion of 100,000 yuan, Cocoa Commission 7.5%, 200,000 to 400,000, higher than 200,000 yuan of the portion, can commission 5% ; Between 400,000 and 600,000 is higher than the portion of 400,000 yuan, can commission 3%, 600,000 to 1 million, higher than 600,000 yuan portion, can commission 1.5%, higher than 1 million yuan, the portion of more than 1 million yuan by 1% Commission, from the keyboard input month profit I, the total bonus should be issued?
defFoo (a):ifa<=100000: Printa*0.1; ifa>100000 anda<=200000: Print10000+ (a-100000) *0.075; ifa>200000 anda<=400000: Print10000+7500+ (a-200000) *0.05; ifa>400000 anda<=600000: Print10000+7500+10000+ (a-400000) *0.03; ifa>600000 anda<=1000000: Print10000+7500+10000+6000+ (a-600000) *0.015; ifa>1000000: Print10000+7500+10000+6000+6000+ (a-1000000) *0.01; Foo (450000)
Python Practice Program (C100 classic Example 2)