commands = "UURDL"

x = 0
y = 0

for i in commands:
    if i == "U":
        y += 1
    elif i == "D":
        y -= 1
    elif i == "L":
        x -= 1
    elif i == "R":
        x += 1

print((x, y))

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: