sum while example

This commit is contained in:
Mert Gör 🇹🇷 2023-05-20 11:49:10 +03:00
parent 5741ab1c3f
commit 116d1e6db7
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

8
sum-while.py Normal file
View 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)