human
Position of robot after given movements | function to find final position of robot after the complete movement.
traverse the instruction string 'move.
for each movement increment its respective counter.
required final position of robot.
Driver code"
How can the above be solved in Python?
 ... Write me a code to position of robot after given movements and the other steps required?
assistant
#Here is code to position of robot after given movements and the other steps required.
 def finalPosition ( move ) :
	l = len ( move )
	countUp , countDown = 0 , 0
	countLeft , countRight = 0 , 0
'
	for i in range ( l ) :
		if ( move [ i ] == ' U ' ) :
			countUp += 1
		elif ( move [ i ] == ' D ' ) :
			countDown += 1
		elif ( move [ i ] == ' L ' ) :
			countLeft += 1
		elif ( move [ i ] == ' R ' ) :
			countRight += 1
	print ( " Final ▁ Position : ▁ ( " , ( countRight - countLeft ) , " , ▁ " , ( countUp - countDown ) , " ) " )
if __name__ == ' _ _ main _ _ ' :
	move = " UDDLLRUUUDUURUDDUULLDRRRR "
	finalPosition ( move )