human
Check if a string is Isogram or not | function to check isogram.
loop to store count of chars and check if it is greater than 1.
if count > 1 , return false.
Driver code.
checking str as isogram.
checking str2 as isogram"
How can the above be solved in Python?
 What is a code to check if a string is Isogram or not and the other steps required?
assistant
#Here is code to check if a string is Isogram or not and the other steps required.
 def check_isogram ( string ) :
	length = len ( string ) ;
	mapHash = [ 0 ] * 26 ;
	for i in range ( length ) :
		mapHash [ ord ( string [ i ] ) - ord ( ' a ' ) ] += 1 ;
		if ( mapHash [ ord ( string [ i ] ) - ord ( ' a ' ) ] > 1 ) :
			return False ;
	return True ;
if __name__ == " _ _ main _ _ " :
	string = " geeks " ;
	string2 = " computer " ;
	if ( check_isogram ( string ) ) :
		print ( " True " ) ;
	else :
		print ( " False " ) ;
	if ( check_isogram ( string2 ) ) :
		print ( " True " )
	else :
		print ( " False " ) ;