Question #169149

Using python im trying to create a code that follows these specifications below

A Picologo program consists of zero or more commands ending with the x command. Any input following an x command is ignored. The Picologo commands sre processed in the order in which they appear.

Picologo programs may also contain blank, zero-length lines that should be skipped and do not otherwise affect processing of the Picologo program.

A nonblank line will contain exactly one Picologo command. A picologo command may be one of the following:

- b: moves the turtle backward 1 unit

- d: places the turtle's pen down

- f: moves the turtle forward 1 unit

- l: turns the turtle to the left by 1 degree

- r: turns the turtle to the right by 1 degree

- u: raises the turtle's pen up

- x: exits the Picologo program

Expert's answer

import turtle


turt = turtle.Turtle()


b = turt.backward(1)
d = turt.pendown()
f = turt.forward(1)
l = turt.left(1)
r = turt.right(1)
v = turt.penup()
x = turt.end_fill()

turtle.done()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS