Questions tagged [python-turtle]

The python turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways.

507 questions
-2
votes
1 answer

Displaying the shortest path along a random walk

I'm a CS teacher, and we wrote some Python code in class to have a turtle draw a random walk. Someone asked if we could draw a new turtle that will trace the route (from starting point to ending point) that will take the minimum path. Current code…
-3
votes
0 answers

turtle that has to avoid random obstacles

Could someone give me some advice on a python program that allows me to move the turtle with the keyboard, which generates random obstacles that if you touch you lose? it's a school assignment and unfortunately I can't get over it: from turtle…
-3
votes
1 answer

How to create color randomizer in python

So I'm still new to using lists and I just want to make the background color change when the player reaches a certain score. All i've been able to piece together is that i need to put it in the mainloop but i don't know how to make a list and much…
PLV
  • 1
-3
votes
1 answer

Turtle collision with its own drawings in python

I want to know if a turtle is in the same place as it was before (for a maze game in python). I tried: import turtle c == 1 a = turtle.Turtle() b = turtle.Turtle() b.fd(100) while c == 1: a.fd(10) if a.is_collided_with(b): …
Jonathan Drukker
  • 111
  • 2
  • 10
-3
votes
1 answer

How to turn the turtle to a specific direction with arrow keys before moving in that direction

I want a program that when I press the arrow keys on the keyboard, the Turtle will first rotate in that direction and then move in that direction with each consecutive press of the same direction. Right now I have: from turtle import * def…
DAB
  • 7
  • 3
-3
votes
1 answer

I am creating a boggle scrambler in python using turtle

I am trying to create a boggle came but the display shows brackets. Please help me remove ALL the brackets and apostrophes when I run the program here is my numpy grid array: Im pretty new to python and I tried:…
-3
votes
1 answer

How to set up end of turtle after selected time

How to set up end of turtle for selected time. For Example how to end turtle after 10 seconds. import time import turtle t1 = turtle hours = 10 minutes = 15 seconds = 20 while True: t1.clear() t1.write(str(hours).zfill(2) + ":" +…
Hypnotikon
  • 29
  • 7
-3
votes
2 answers

The class "turtles" has no attribute "forward" (Python Turtle)

I am trying to make a turtle race, but I get an error that the class "turtles" has no attribute "forward". Here is my code: class turtles: def __init__(self, color, posX): self = turtle.Turtle(shape='turtle', visible=False) …
-3
votes
3 answers

'str' object has no attribute 'turtle' in Python turtle

I'm trying to write turtle code with turtle shape and a color and drawing T letter. The following is my code: It gives me run time Error with shape! Please help me to correct it! Thanks import turtle # Import the required library ft =…
Far
  • 1
-4
votes
1 answer

Python will not accept a variable I entered

I entered a variable in python, but it will not be accepted. I'm not sure why this is happening. I have tried to change the name of the variable, changing capitalization in the name of it, and changing the input key for the function. My code…
-4
votes
2 answers

Why does "turtle.pd" produce a syntax error in my Python code?

I was trying to make a sort-of complex parametric grapher, but that isn't what's important. What's important is that my program is supposed to draw a circle using Turtle graphics, and when I put the pen down, I have a syntax error in the…
1 2 3
33
34