human
Write me a code to check if count of Alphabets and count of Numbers are equal in the given String and the other steps required given the following:
Check if count of Alphabets and count of Numbers are equal in the given String | Function to count the number of alphabets.
Counter to store the number of alphabets in the string.
Every character in the string is iterated.
To check if the character is an alphabet or not.
Function to count the number of numbers.
Counter to store the number of alphabets in the string.
Every character in the string is iterated.
To check if the character is a digit or not.
Function to check if the count of alphabets is equal to the count of numbers or not.
Driver code"
Solution in Python:
assistant
#Here is code to check if count of Alphabets and count of Numbers are equal in the given String and the other steps required.
 def countOfLetters ( string ) :
	letter = 0 ;
	for i in range ( len ( string ) ) :
		if ( ( string [ i ] >= ' A ' and string [ i ] <= ' Z ' ) or ( string [ i ] >= ' a ' and string [ i ] <= ' z ' ) ) :
			letter += 1 ;
	return letter ;
def countOfNumbers ( string ) :
	number = 0 ;
	for i in range ( len ( string ) ) :
		if ( string [ i ] >= '0' and string [ i ] <= '9' ) :
			number += 1 ;
	return number ;
def check ( string ) :
	if ( countOfLetters ( string ) == countOfNumbers ( string ) ) :
		print ( " Yes " ) ;
	else :
		print ( " No " ) ;
if __name__ == " _ _ main _ _ " :
	string = " GeeKs01324" ;
	check ( string ) ;