sum while example
This commit is contained in:
parent
5741ab1c3f
commit
116d1e6db7
1 changed files with 8 additions and 0 deletions
8
sum-while.py
Normal file
8
sum-while.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
a = [3, 4, 3, 5, 10]
|
||||
total = 0
|
||||
i = 0
|
||||
while i < len(a):
|
||||
total += a[i]
|
||||
i += 1
|
||||
avg = total / len(a)
|
||||
print('Ortalama =', avg)
|
Loading…
Reference in a new issue