#-*-coding:utf-8-*-#filename:001.py#title: There are 1,2,3,4 numbers, can make up how many different and no duplicate number of three digits? Output ResultsCNT= 0#count the sum of result forIinchRange (1, 5): forJinchRange (1, 5): forKinchRange (1,5): ifI!=j andI!=k andj!=K:Printi*100+j*10+K-CNT+=1Print "there are three digits with no repetition number:"Cnt
__author__='Li'#-*-coding:utf-8-*-#filename:002.py#Title: The bonuses awarded by the Enterprise are based on 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, 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? I= Int (Raw_input ('Enter the Profit:')) Arr= [1000000, 600000, 400000, 200000, 100000, 0]rat= [0.01, 0.015, 0.03, 0.05, 0.075, 0.1]r=0 forIdxinchRange (0, 6): ifi > Arr[idx]:#judge, and then calculate the out-of-section, calculating each level separatelyR + = (I-arr[idx]) *Rat[idx]Print(I-arr[idx]) *Rat[idx] I=Arr[idx]Print 'Total Profit:'+ U
[Python] Programming language Introduction Classic 100 questions