0% found this document useful (0 votes)
10 views1 page

Python 3.12.3 Sum Calculation Example

The document shows a Python 3.12.3 interactive session where a variable 'sum' is initialized and updated in a loop. The loop iterates from 1 to 9, adding the incremented count to 'sum'. The output displays the cumulative sum at each iteration.

Uploaded by

ndumisok.112
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Python 3.12.3 Sum Calculation Example

The document shows a Python 3.12.3 interactive session where a variable 'sum' is initialized and updated in a loop. The loop iterates from 1 to 9, adding the incremented count to 'sum'. The output displays the cumulative sum at each iteration.

Uploaded by

ndumisok.112
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.

1938 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> sum = 1 #240069159
>>> for count in range(1,10):
... sum = sum + (count + 1)
... sum
...
...
3
6
10
15
21
28
36
45
55

You might also like