Answer to Question #334042 in Python for Xix

Question #334042

Write the correct title code that will do the following.





1) Ask the user to put the name of the nurtle screen.





2) Ask the user to input the background color of the turtle screen.





3) Ask the user to input a number that will instruct the turtle to move in accordance with number entered.





4) Ask the user to mput a number that will instruct the tunle to turn in accordance with the number





1
Expert's answer
2022-04-26T14:48:58-0400
from turtle import *
from turtle import TurtleGraphicsError



def set_bg_color():
    try:
        t.screen.bgcolor(textinput("Background", "Background color:"))
    except TurtleGraphicsError:
        set_bg_color()



t = Turtle()
window = Screen()
window.title(textinput("Title", "Window title:"))
t.right(numinput("Turn", "Turn right", minval=0))
t.fd(numinput("Move", "Move forward", minval=0))
set_bg_color()
t.screen.mainloop()

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS