removing all occurrence of a number in a list

Sai_kiran_rachakonda · November 01, 2022
list1 = [5, 20, 15, 20, 25, 50, 20]
for i in list1:
    if i != 20:
        print(i)
    if i == 20:
        continue
Output

Comments

Please sign up or log in to contribute to the discussion.