Using Loops to track user input

Cousin Stanley CousinStanley at hotmail.com
Sun Jul 6 17:33:53 EDT 2003


| Write a program that reads 10 numbers from the user
| and prints out the sum of those numbers.

hokiegal ...

Here is one way ...

nLoops = 10
total  = 0

for i in range( nLoops ) :

    num_in = int( raw_input( 'Enter an Integer :  ' ) )

    total += num_in

print total

-- 
Cousin Stanley
Human Being
Phoenix, Arizona






More information about the Python-list mailing list