How to use while loop with index to print a list in Python

1 Answer

0 votes
numbers = [4, 6, 8, 1, 23]

i = 0
while i < len(numbers):
    print(numbers[i])
    i += 1



'''
run:

4
6
8
1
23

'''

 



answered Aug 21, 2019 by avibootz

Related questions

1 answer 356 views
1 answer 327 views
2 answers 321 views
321 views asked Apr 23, 2021 by avibootz
1 answer 316 views
316 views asked Sep 5, 2018 by avibootz
1 answer 219 views
219 views asked May 7, 2017 by avibootz
...