I want to use a for loop to calculate the number of times a character in one string occurs in another string.
e.g. if string1 = 'python' and string2 = 'boa constrictor' then it should calculate to 6 (2 t's, 3 o's, 1 n)
Does anyone know how to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…