모범답안대로 작성을 하면
Enter Hours:
에 문자열을 입력해도 곧바로 에러 메세지가 나오지 않습니다. Enter Rate: 까지 입력하고 둘을 한꺼번에 판단하는 것 같네요.
원하는 결과를 얻기 위해서는
xx = input("Enter Hours: ")
try:
hh = float(xx)
except:
print("Please input numeric value")
quit()
yy = input("Enter Rate: ")
try:
rr = float(yy)
except:
print("Please input numeric value")
quit()
라고 해야 하지 않을까요??
comment