elif(else if) 그렇지 않고 만약
score=int(input('점수를 입력하세요:'))
if score>=80:
grade='A'
elif score>=60:
grade='B'
elif score>=40:
grade='C'
else:
grade='Fail'
print('시험점수:%d' %score)
print('시험등급:%s' %grade)
중첩 if문
if문 안에 다른 if문을 넣어 중첩 if문을 만들음
a=input('사과의 상태를 입력하세요:')
b=int(input('사과의 가격을 입력하세요:'))
if a=='신선':
if b<1000:
print('10개를 산다')
else:
print('5개를 산다')
else:
print('사과를 사지 않는다')
출처:
https://nxuuo.tistory.com/5
https://hcr3066.tistory.com/56

