【发布时间】:2023-03-03 15:02:01
【问题描述】:
h = int(input ("Enter your working hours in a week:"))
rate = 8
if ((h < 0 ) or (h > 168)):
print("INVALID")
elif h <= 40:
print ("YOU MADE", rate*h, "DOLLARS THIS WEEK")
elif 41 <= h <= 50:
print("YOU MADE", int(40 * rate + (h - 40) * (1.129 * rate)), "DOLLARS THIS WEEK")
else:
print("YOU MADE",int(40 * rate + (h - 40) * 1.20373 * rate), "DOLLARS THIS WEEK")
【问题讨论】:
-
(h < 0 ) and (h > 168)是不可能的 - 你的意思是or吗? -
你说得对,我写的很匆忙,我的意思是一样的或
标签: python python-3.x printing format