1# string replace() function perfectly solves this problem:
2
3# string.replace(s, old, new[, maxreplace])
4
5# Return a copy of string s with all occurrences of substring old replaced
6# by new. If the optional argument maxreplace is given, the first maxreplace
7# occurrences are replaced.
8
9>>> u'longlongTESTstringTEST'.replace('TEST', '?', 1)
10u'longlong?stringTEST'
1# find index of second occurence of substring in string
2idx = string.find(substring, string.find(substring) + 1)
3
1#iterate through list
2for item in yourlist:
3 #if item is equal to a value
4 if item == 'value':
5 #store the item in a variable
6 yourvar = item
7 #break out of loop
8 break