print("Welcome to the Age Classifier program")
person_age=(float(input("Enter the person's Age"))
if person_age<=1 or person_age>0:
print("Person is an infant")
elif person_age>1 or person_age<13:
print("Person is a child")
elif person_age>=13 or person_age<20:
print("Person is a teenager")
elif person_age>=20 :
print("Person is an adult")
else:
print("Person has not been conceived or is developing in the womb")
, 인터프리터는 if
문의 몸의 1 라인에 오류 메시지가 구문이 잘못되었음을보고와 함께,이 있음을보고합니다. 나는 괄호를 추가하려고 시도하고 동일한 구문 오류가 발생했습니다.나이 분류 파이썬 프로그램은
이 경우 입력이 -1 인 경우에도 "Person is infant"가 출력됩니다. –