2, Title: The bonus awarded by the enterprise according to the profit commission. 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, the portion of less than 100,000 yuan by 10% commission, higher than the portion of 100,000 yuan, a commission of 7.5%, 200,000 to 400,000, higher than 200,000 yuan, 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?
m = input ('Please enter your profit:') M=float (m)#if the profit (I) is less than or equal to $100,000, the bonus may be 10%;#profit above 100,000 yuan, less than 200,000 yuan, less than 100,000 yuan in part by 10% commission, higher than the portion of 100,000 yuan, Cocoa Commission 7.5%;#between 200,000 and 400,000, higher than 200,000 yuan of the portion, can commission 5;#400,000 to 600,000 is higher than the portion of 400,000 yuan, can commission 3;#between 600,000 and 1 million, higher than 600,000 yuan of the portion, can commission 1.5%,#above 1 million yuan, more than 1 million yuan of the portion by 1% CommissionLRT= [1000000,600000,400000,200000,100000, 0]rate= [0.01,0.015,0.03,0.05,0.075,0.1]income=0 forTempinchRange (0,6): ifM >Lrt[temp]: Income+ = (M-lrt[temp]) *Rate[temp] M=Lrt[temp]Print(income)
"Python Exercises" program 2