Tried putting it as a range but says that two operations cannot be done.
Check for collisions with barrier
if (head.ycor()<200 and head.ycor()>-200 and head.xcor()<10 and head.xcor()>-10):
time.sleep(1)
head.goto(-70, 0)
head.direction = "stop"
head.clear()
# Barrier
barrier = turtle.Turtle()
barrier.shape("square")
barrier.color("yellow")
barrier.speed(0)
barrier.goto(0, 0)
barrier.shapesize(stretch_len=1, stretch_wid=20)
barrier.penup()