프로그램

[파이썬] 문제 : yes일때 숫자 입력 받아서 total에 더하

오디세이99 2023. 4. 27. 18:21
728x90
반응형

total = 0
answer = 'yes'

while answer == 'yes':
    n = int(input('숫자를 입력하시오: '))
    total += n
    answer = input('계속? (ys/no)')
    
print('합계는 :',total)

728x90
반응형