Answer
The answer and procedures of the exercise are attached in the following archives.
Step-by-step explanation:
You will find the procedures, formulas or necessary explanations in the archive attached below. If you have any question ask and I will aclare your doubts kindly.
Answer:
def theRoundTrip(movement):
x=0
y=0
for i in movement:
if i not in ["U","L","D","R"]:
print("bad input")
return
if i=="U":
y+=1
if i=="L":
x-=1
if i=="D":
y-=1
if i=="R":
x+=1
return x==0 and y==0