pop a string from a list python

Solutions on MaxInterview for pop a string from a list python by the best coders in the world

showing results for - "pop a string from a list python"
Mayssa
03 May 2020
1my_list = [12, 'Siya', 'Tiya', 14, 'Riya', 12, 'Riya']
2my_list.remove(12) # it will remove the element 12 at the start.
3print(my_list)
4my_list.remove('Riya') # will remove the first Riya from the list
5print(my_list)
6my_list.remove(100)  #will throw an error
7print(my_list)
8