human
Print all strings from given array that can be typed using keys from a single row of a QWERTY keyboard | Function to print all strings that can be typed using keys of a single row in a QWERTY Keyboard.
Stores row number of all possible character of the strings.
Traverse the array.
If current string is not an empty string.
Sets true / false if a string can be typed using keys of a single row or not.
Stores row number of the first character of current string.
Stores length of word.
Traverse current string.
If current character can 't be  typed using keys of rowNum only.
Update flag.
If current string can be typed using keys from rowNum only.
Print the string.
Driver Code"
Solution in Python:
 ... Can you provide a code to print all strings from given array that can be typed using keys from a single row of a QWERTY keyboard and the other steps required?
assistant
#Here is code to print all strings from given array that can be typed using keys from a single row of a QWERTY keyboard and the other steps required.
 def findWordsSameRow ( arr ) :
	mp = { ' q ' : 1 , ' w ' : 1 , ' e ' : 1 , ' r ' : 1 , ' t ' : 1 , ' y ' : 1 , ' u ' : 1 , ' o ' : 1 , ' p ' : 1 , ' i ' : 1 , ' a ' : 2 , ' s ' : 2 , ' d ' : 2 , ' f ' : 2 , ' g ' : 2 , ' h ' : 2 , ' j ' : 2 , ' k ' : 2 , ' l ' : 2 , ' z ' : 3 , ' x ' : 3 , ' c ' : 3 , ' v ' : 3 , ' b ' : 3 , ' n ' : 3 , ' m ' : 3 }
	for word in arr :
		if ( len ( word ) != 0 ) :
			flag = True
			rowNum = mp [ word [ 0 ] . lower ( ) ]
			M = len ( word )
			for i in range ( 1 , M ) :
				if ( mp [ word [ i ] . lower ( ) ] != rowNum ) :
					flag = False
					break
			if ( flag ) :
				print ( word , end = ' ▁ ' )
words = [ " Yeti " , " Had " , " GFG " , " comment " ]
findWordsSameRow ( words )