if语句,有大佬解答一下吗?谢谢!
这个怎么简化(print里面的表达式怎么定义)?unm=int(input("I"))
print(unm)
res="answer"
if unm < 100000 or unm==1000000:
print("res(100000*10%)")
elif unm>100000 or unm<200000:
print("res((unm-100000)*7.5%+100000*10%)")
elif unm>200000 or unm<400000:
print("res((unm-200000)*5%+unm-100000)*7.5%+100000*10%)")
elif unm>400000 or unm<600000:
print("(res(unm-400000)*3%+(unm-200000)*5%+unm-100000)*7.5%+100000*10%)")
elif unm>600000 or unm<1000000:
print("res((unm-600000)*1.5%+unm-400000)*3%+(unm-200000)*5%+unm-100000)*7.5%+100000*10%)")
else :
print("res((unm-1000000)*1%+(unm-600000)*1.5%+unm-400000)*3%+(unm-200000)*5%+unm-100000)*7.5%+100000*10%)")
[此贴子已经被作者于2018-11-1 13:12编辑过]