human
Print consecutive characters together in a line | Python3 program to print consecutive characters together in a line ..
Driver Code"
How can the above be solved in Python?
 What is a code to print consecutive characters together in a line and the other steps required?
assistant
#Here is code to print consecutive characters together in a line and the other steps required.
 def _print ( string ) :
	print ( string [ 0 ] , end = " " )
	for i in range ( 1 , len ( string ) ) :
		if ( ord ( string [ i ] ) == ord ( string [ i - 1 ] ) + 1 or ord ( string [ i ] ) == ord ( string [ i - 1 ] ) - 1 ) :
			print ( string [ i ] , end = " " )
		else :
			print ( )
			print ( string [ i ] , end = " " )
if __name__ == " _ _ main _ _ " :
	string = " ABCXYZACCD "
	_print ( string )