How to use while loop with continue in Python

1 Answer

0 votes
lst = ["python", "c", "c++", "java", "php"]

i = 0
while i < len(lst):
    item = lst[i]
    i += 1

    if item == "c++":
        continue

    print(item)


'''
run:

python
c
java
php

'''

 



answered Sep 5, 2018 by avibootz

Related questions

2 answers 295 views
1 answer 303 views
2 answers 236 views
3 answers 183 views
1 answer 173 views
...