updating first occurrence of a number in a list

Sai_kiran_rachakonda · November 01, 2022
list1 = [5, 10, 15, 20, 25, 50, 20]
x = list1.index(20)
list1[x] = 200
print(list1)
Output

Comments

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