1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Juli2301 [7.4K]
3 years ago
8

I am coding a turtle race in python I have to Use a single call to forward for each turtle, using a random number as the distanc

e to move
Computers and Technology
2 answers:
german3 years ago
5 0

import turtle,random

s = turtle.getscreen()

t1 = turtle.Turtle()

t2 = turtle.Turtle()

t3 = turtle.Turtle()

t2.penup()

t2.goto(1,100)

t3.penup()

t3.goto(1,200)

while True:

   t1.forward(random.randint(1,10))

   t2.forward(random.randint(1,10))

   t3.forward(random.randint(1,10))

   if t1.xcor() >= 180:

       print("Turtle 1 won the race!")

       quit()

   elif t2.xcor()>= 180:

       print("Turtle 2 won the race!")

       quit()

   elif t3.xcor() >= 180:

       print("Turtle 3 won the race")

       quit()

I hope this helps!

lesantik [10]3 years ago
3 0

Answer:

if you mean to set a speed. Im not sure. however, move turtle.forward(random number) i can do

import turtle

import random

random_int = random.randint(20, 1000)

win = turtle.Screen()

turtle_1 = turtle.Turtle()

turtle_1.forward(random_int)

win.mainloop()

You might be interested in
How many grams are in 100 pounds?
stepan [7]

Answer:

45359.2 grams are in 100 pounds

Explanation:

Hope this helped, Have a Wonderful Day!!

3 0
3 years ago
Read 2 more answers
As an IT technician, you are responsible for maintaining your company's laser printers. Recently, you read that laser printers h
nasty-shy [4]

Answer:

When the drums revolution is completed, the toner still remaining on the photoreceptor drum is cleaned by a plastic blade that is made of soft electrically neutral material which then deposits waste toner into a toner reservoir in the printer. The drum is then charged to become uniformly negatively charge by a rolling charger to prepare the drum for the beam from the laser.

Explanation:

8 0
3 years ago
If i'm watching a show on netflix without any extra speakers besides the normal one on my tv, what setting should i use? English
sweet-ann [11.9K]
5.1 is higher quality
8 0
3 years ago
Read 2 more answers
Your instructor has asked you to perform some research regarding a computer OS capability of distinguishing spoken words. What i
tekilochka [14]
It’s A !!!!!!!!! Just did it
3 0
3 years ago
When you go to a website, your web browser requests a web page from:
lakkis [162]

Answer: web server

Explanation:

When you go to a website, your web browser requests a web page from the web server. For this to happen, the IP address for the webpage has to be identified first, tmaftee which the browser will request appropriate data from the web server.

Such request comes in form of data packet and takes place through HTTP and.utnhas all the necessary information that is needed by the web server for the delivery of the webpage data.

3 0
3 years ago
Other questions:
  • Which key is used in word processors to create indentations?
    13·2 answers
  • Difference between softcopy and hardcopy​
    8·2 answers
  • How do i get more coding programs
    14·2 answers
  • Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
    7·1 answer
  • If you enter 234.567 into a cell that is formatted to display 1 decimal place, what is the value stored in the cell?
    13·1 answer
  • What occurs when an application sends user-fed data directly to a web browser without authenticating or deleting the content? Cr
    15·1 answer
  • What were second generation languages that required detailed knowledge of the computer's hardware and a lot of spare time to wri
    11·1 answer
  • Design a class named Person with fields for holding a person’s name, address, and telephone number. Write one or more constructo
    12·1 answer
  • Select the correct answer.
    15·1 answer
  • You would like the word "Employee" to appear in cells A1, B1, C1, D1, and E1. To be efficient, you should
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!