while examples

This commit is contained in:
Mert Gör 🇹🇷 2023-05-20 07:58:06 +03:00
parent 2ab15cf61b
commit db1e78d12b
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 12 additions and 0 deletions

6
1-100.py Normal file
View File

@ -0,0 +1,6 @@
i = 1
total = 0
while i <= 100:
total += i
i += 1
print(total)

6
list-while.py Normal file
View File

@ -0,0 +1,6 @@
a = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
i = 0
while i < len(a):
print(a[i], end=' ')
i += 1