4 calculates from 1 to 100 and

# Calculates the sum from 1 to 100. 
n-= 100 
SUM = 0 
counter =. 1
 the while counter <= n-: 
    SUM + = counter 
    counter + =. 1 Print ( " . 1 to% d sum of:% d " % (n-, SUM) )

result:

Guess you like

Origin www.cnblogs.com/CPU-Easy/p/12116190.html