파이썬 if 조건문 오류
조회수 490회
# registration number=rn
rn = int(input ("주민등록번호를 (-) 빼고 입력하세요 : "))
year = int(rn/100000000000)
month = int(rn/1000000000) - year*100
day = int(rn/10000000) - (int(rn/1000000000)*100)
if 21 <= year <= 99
print("출생년도 : " + str(1900+year) + " 월 : " + str(month) + " 일 : " + str(day))
elif 00 <= year <= 20
print("출생년도 : " + str(2000+year) + " 월 : " + str(month) + " 일 : " + str(day))
이렇게 하면..
실행 중 오류가 발생했습니다.
File "/solution.py", line 10
if 21 <= year <= 99
^
SyntaxError: invalid syntax
이런 류가 뜹니다..ㅠㅠ 파이썬 방금 시작해서 잘 모릅니다... 왜 오류가 뜨는지 알려주시면 감사하겠습니다. ㅠㅠ
-
(•́ ✖ •̀)
알 수 없는 사용자
1 답변
-
if 21 <= year <= 99:
초보들은 신택스 에러의 바로 앞 구문도 살펴보는 버릇을 들이세요.
댓글 입력