# summing up all numbers from 0 to N, using a for loop # get N from the user N_string = raw_input("please enter N: ") N = int(N_string) # compute the sum total = 0 for i in range(0, N+1): total = total + i # print the result print "total =", total