Arrays

  • + 1 comment

    This is my code, why you need two for loops and make this complex?

    This is my code:

    string, substring = (input().strip(),input().strip) count = 0 for i in range(0, len(string)-len(substring)+1): if string[i:i+len(substring)]==substring: count+=1 return count