Python Forum
using input() to control python turtles
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using input() to control python turtles
#1
I wrote the code below to try to get the turtle below to move the amount input, but I cannot seem to figure out why defining c will not work. How can I get the input to work? I keep getting an error message "ExternalError: TypeError: Cannot read property 'instance' of undefined on line 13." Line 13 is turtle.forward(int©).
import turtle
myTurtle = turtle.Turtle()
myTurtle.forward(100)
myTurtle.right(90)
myTurtle.penup()
myTurtle.forward(100)
myTurtle.right(90)
myTurtle.pendown()
myTurtle.pencolor("green")
myTurtle.right(90)
myTurtle.forward(100)
c=input(int())
turtle.forward(int(c))
myTurtle.back(100)
Reply


Messages In This Thread
using input() to control python turtles - by amh80 - Jan-09-2020, 07:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  db migration(db version control) for python lubaz 2 2,780 May-30-2021, 01:36 PM
Last Post: lubaz
  python 3 raspberry pi 4 dual control motor programming problem yome 0 1,990 Mar-21-2021, 05:17 PM
Last Post: yome
  Use of input function to change screen background color in Turtles Oldman45 3 4,908 Jul-10-2020, 09:54 AM
Last Post: Oldman45
  control a linux program with python Fifoux082 9 4,116 May-08-2020, 04:24 PM
Last Post: Fifoux082
  Python 3+ kybd and mouse control keycodes ineuw 5 2,921 Aug-20-2019, 07:51 AM
Last Post: ineuw
  Windows Volume Control using python Arun 1 4,771 May-17-2019, 02:50 PM
Last Post: Larz60+
  Remote control of the Visual Studio 2013 debug menu using Python MariusTo 0 2,483 Jan-17-2018, 04:58 PM
Last Post: MariusTo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020