Help me in solving XYSTRP problem

My issue

T = map(int, input().split())
N = map(int, input().split())

l =
count = 0

for i in range(N):
if(l[i] == ‘X’ and l[i+1] == ‘Y’):
count == count + 1
print(count)
elif(l[i] == ‘X’ and l[i+1] == ‘Y’):
count == count + 1
print(count)
elif(l[i] == ‘X’ and l[i+1] == ‘X’):
count = count
print(count)
else:
count = count
print(count)

whats the problem here?

My code

# cook your dish here

T = map(int, input().split())
N = map(int, input().split())

l = []
count = 0

for i in range(N):
    if(l[i] == 'X' and l[i+1] == 'Y'):
        count == count + 1
        print(count)
    elif(l[i] == 'X' and l[i+1] == 'Y'):
        count == count + 1
        print(count)
    elif(l[i] == 'X' and l[i+1] == 'X'):
        count = count 
        print(count)
    else:
        count = count
        print(count)
            
    
    
    


Learning course: Greedy Algorithms
Problem Link: Chef and String Practice Problem in Greedy Algorithms - CodeChef

@reetayd1992
here ,plzz refer my c++ code for better understanding of logic

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    string s;
	    cin>>s;
	    int ans=0;
	    for(int i=1;i<s.size();i++)
	    {
	        if(s[i]!=s[i-1])
	        {
	            ans++;
	            i++;
	        }
	    }
	    cout<<ans<<endl;
	}

}