Your use of indentation and spacing was very inconsistent. And the use of comments was not right. That probably was the issue. To learn about indentation here
The new code would be
# why (comments start with # )
inp = input('Enter Hours: ')
try:
Hours = float(inp)
except:
print('Error. please enter numeric input')
quit() # Inconsistent indenting makes unreachable (and unreadable) code.
inp2 = input('Enter Rate: ')
try:
Rate = float(inp2)
except:
print('Error. please enter numeric input')
quit()
if Hours > 40 :
Pay = (Hours * 10) + (Hours - 40) * (1.5)
print('Pay: ', Pay)
elif 0 < Hours <= 40 :
Pay = Hours * Rate
print('Pay= ', Pay)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…