# Whilesum.py Copyright (c) Kari Laitinen # http://www.naturalprogramming.com # 2006-02-24 File created. # 2022-12-16 Converted to Python 3. integer_from_keyboard = -1 sum_of_integers = 0 print( "\n This program calculates the sum of the integers" \ "\n you type in from the keyboard. By entering a" \ "\n zero you can terminate the program. \n" ) while integer_from_keyboard != 0 : print( " Current sum: %8d Enter an integer: " % sum_of_integers, end="" ) integer_from_keyboard = int( input() ) sum_of_integers = sum_of_integers + integer_from_keyboard print( "\n" )