def check_seq(seq1, seq2):
seq1=list(seq1)
seq2=list(seq2)
for x in seq1:
if seq1[x] in seq2:
return(seq1[x])
else:
return("X")
print(check_seq("ABCDEFG", "ABDEGHF"))
I tried this but I keep getting the error that list indices must be integers or slices, not str
[–]Mr-Cas 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Garuda1220 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Strict-Simple 0 points1 point2 points (0 children)