Home > other >  Big fast deliver online emergency!!!
Big fast deliver online emergency!!!

Time:09-22

CodePudding user response:

 sum=0 
A=int (input (" please enter a number, calculates the 1 + 2 +.. + n \ n "))
For I in range (a + 1) :
The sum +=I
Print (" 1 + 2 +... + % % d=% d "(a sum))


Please enter a number, calculates 1 + 2 +... + n
5
1 + 2 +... + 5=15

CodePudding user response:

Sum1=0
Num=int (input (' input integer: '))
Print (num, sum (the list (I for I in range (1, num + 1))))
  • Related