Orange C.

asked • 05/02/22

How do I make the integers in a Python parameter equate to seconds without using the built-in time module?

I am trying to make a box appear and disappear in random 1-5 second intervals.

This is what I wrote:


box.showturtle(box.randint(1,5))

box.hideturtle(box.randint(1,5))


The randint is supposed to pick an integer between 1 through 5, which I ideally want to represent seconds so that the box shows itself for a random amount of time between 1-5 seconds long, and then hides for a random amount of time between 1-5 seconds as well.


I'm stuck because, these numbers are just integers. I don't know how to make them equate to a quantity of seconds. And also I'm not sure if the way I wrote the parameters would even work.

1 Expert Answer

By:

Donald W. answered • 05/03/22

Tutor
5.0 (214)

Senior Software Engineer with over 25 years of industry experience

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.