05. Programing Language/[Python] 2.모두를 위한 프로그래밍 파이썬
[Python] 2-6 <실습> 반복문
인러너
2020. 1. 7. 22:14
조금씩 난이도가 올라가네요
num = 0
tot = 0.0
while True :
sval = input('Enter a number: ')
if sval == 'done':
break
try:
fval = float(sval)
except:
print('Invalid input')
continue
num = num + 1
tot = tot + fval
print(tot, num, tot/num)
-continue가 좋은 선택이네요
모두 재밌게 파이썬 하세요~^^
와우 드디어 수료했습니다!