human
Check whether the string can be printed using same row of qwerty keypad | Function to find the row of the character in the qwerty keypad.
Sets to include the characters from the same row of the qwerty keypad.
Condition to check the row of the current character of the string.
Function to check the characters are from the same row of the qwerty keypad.
Driver Code"
How can the above be solved in Python?

=====
Can you provide a code to check whether the string can be printed using same row of qwerty keypad and the other steps required?
assistant
#Here is code to check whether the string can be printed using same row of qwerty keypad and the other steps required.
 def checkQwertyRow ( x ) :
	first_row = [ '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '0' , ' - ' , ' = ' ]
	second_row = [ ' Q ' , ' W ' , ' E ' , ' R ' , ' T ' , ' Y ' , ' U ' , ' I ' , ' O ' , ' P ' , ' [ ' , ' ] ' , ' q ' , ' w ' , ' e ' , ' r ' , ' t ' , ' y ' , ' u ' , ' i ' , ' o ' , ' p ' ]
	third_row = [ ' A ' , ' S ' , ' D ' , ' F ' , ' G ' , ' H ' , ' J ' , ' K ' , ' L ' , ' ; ' , ' : ' , ' a ' , ' s ' , ' d ' , ' f ' , ' g ' , ' h ' , ' j ' , ' k ' , ' l ' ]
	fourth_row = [ ' Z ' , ' X ' , ' C ' , ' V ' , ' B ' , ' N ' , ' M ' , ' , ' , ' . ' , ' / ' , ' z ' , ' x ' , ' c ' , ' v ' , ' b ' , ' n ' , ' m ' ]
	if ( first_row . count ( x ) > 0 ) :
		return 1
	elif ( second_row . count ( x ) > 0 ) :
		return 2
	elif ( third_row . count ( x ) > 0 ) :
		return 3
	elif ( fourth_row . count ( x ) > 0 ) :
		return 4
	return 0
def checkValidity ( str ) :
	x = str [ 0 ]
	row = checkQwertyRow ( x )
	for i in range ( len ( str ) ) :
		x = str [ i ]
		if ( row != checkQwertyRow ( x ) ) :
			return False
	return True
str = " GeeksforGeeks "
if ( checkValidity ( str ) ) :
	print ( " Yes " )
else :
	print ( " No " )