How to remove the first item from list which matches a specified value in Python

1 Answer

0 votes
lst = ['a', 'b', 'c', 'b', 'e', 'b', 'g'];

lst.remove('b')
    
print(lst)


    
'''
run:
    
['a', 'c', 'b', 'e', 'b', 'g']

'''
  
  

 



answered Jun 23, 2020 by avibootz
...