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 319 views
1 answer 325 views
2 answers 248 views
3 answers 198 views
1 answer 195 views
...