Answer the question
In order to leave comments, you need to log in
How to replace a substring in a string with an element of a list?
Good day!
There is a string: string \/ ****** .jpg (the highlighted part is always the same, the asterisks are a numeric number, which can be of any size)
There is a list of numbers in which the first element always corresponds to the number from the string.
You need to get a new list of strings with all numbers.
Answer the question
In order to leave comments, you need to log in
first_number = numbers[0]
for i in numbers:
links = (link.replace(first_number, i)).split()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question