human
Count the minimum number of groups formed in a string | Function to count the minimum number of groups formed in the given string s.
Initializing count as one since the string is not NULL.
Comparing adjacent characters.
Driver Code"
How can the above be solved in Python?
 Write me a code to count the minimum number of groups formed in a string and the other steps required?
assistant
#Here is code to count the minimum number of groups formed in a string and the other steps required.
 def group_formed ( S ) :
	count = 1
	for i in range ( len ( S ) - 1 ) :
		a = S [ i ]
		b = S [ i + 1 ]
		if ( a != b ) :
			count += 1
	print ( count )
if __name__ == " _ _ main _ _ " :
	S = " TTWWW "
	group_formed ( S )