human
Check if the number is valid when flipped upside down | Function that returns true if str is Topsy Turvy.
For every character of the string.
If the current digit cannot form a valid digit when turned upside - down.
Driver code"
Solution in Python:
 What is a code to check if the number is valid when flipped upside down and the other steps required?
assistant
#Here is code to check if the number is valid when flipped upside down and the other steps required.
 def topsyTurvy ( string ) :
	for i in range ( len ( string ) ) :
		if ( string [ i ] == '2' or string [ i ] == '4' or string [ i ] == '5' or string [ i ] == '6' or string [ i ] == '7' or string [ i ] == '9' ) :
			return False ;
	return True ;
if __name__ == " _ _ main _ _ " :
	string = "1234" ;
	if ( topsyTurvy ( string ) ) :
		print ( " Yes " ) ;
	else :
		print ( " No " ) ;