while examples
This commit is contained in:
parent
2ab15cf61b
commit
db1e78d12b
6
1-100.py
Normal file
6
1-100.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
i = 1
|
||||
total = 0
|
||||
while i <= 100:
|
||||
total += i
|
||||
i += 1
|
||||
print(total)
|
6
list-while.py
Normal file
6
list-while.py
Normal 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
|
Loading…
Reference in New Issue
Block a user