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 312 views
1 answer 318 views
2 answers 243 views
3 answers 191 views
1 answer 185 views
...