Answer the question
In order to leave comments, you need to log in
How to remove a value from a list?
How to remove the value of the second list from the list, if it is present?
a = 'test'
b = 'test stroka'
l = [a, b]
if a in b:
удалить test из b
результатом должно быть - 'stroka'
Answer the question
In order to leave comments, you need to log in
a = 'test'
b = 'test stroka'
if a in b:
b = "".join(b.split(a))
a = 'test'
b = 'test stroka'
l = [a, b]
if a in b:
b = "".join(b.split(a))
l[1] = b
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question