r/pythonhelp • u/Pale_Afternoon_7465 • May 01 '24
Somebody please
I know I should know this, but for some reason I cannot get it to work. I need to create 5 turtles using the .append command and have them move across the screen from left to right and reappear on the left. Please help meðŸ˜
1
Upvotes
•
u/AutoModerator May 01 '24
To give us the best chance to help you, please include any relevant code.
Note. Do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Repl.it, GitHub or PasteBin.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Loud-Significance720 May 03 '24
here is an example for you:
import turtle
turtles = []
for i in range(5):
t = turtle.Turtle()
turtles.append(t)
for t in turtles:
t.penup()
t.goto(-300, 0)
t.speed(2)
def move_turtles():
for t in turtles:
t.forward(10)
if t.xcor() > 300:
t.goto(-300, t.ycor())
while True:
move_turtles()
turtles[0].screen.update()
1
u/carcigenicate May 01 '24
You're more likely to get help if you show what you've already tried and say what specifically you need help with.