Angelinamlopez9438 Angelinamlopez9438
  • 13-01-2021
  • Computers and Technology
contestada

using a timer to generate a random number, develop a program that displays random numbers between 1 and 47 (or whatever) for your state's lottery

Respuesta :

sandlee09
sandlee09 sandlee09
  • 16-01-2021

Answer:

Explanation:

The following code is written in Python. It creates a variable that detects the current time. Then it loops through a range of numbers and chooses the last random number after 2 seconds. Finally, it prints that number to the screen. This function can be called countless times depending on the number of state lottery numbers needed.

import random

import time

start_time = time.time()

while time.time() - start_time < 2:

   lottery_number = random.randint(0, 48)

print(lottery_number)

Answer Link

Otras preguntas

Can someone please explain this to me
Plz help me with this
"how often should an organization's vision/mission be changed in light of strategy evaluation activities?"
Write logical sentences to say where the following people go in Spanish using the verbs IR:1. Me gustan las películas2. A Carlos le gusta ir de compras3. A ello
Why did mexicans and immigrants from other latin american countries migrate to the united states
Help! Give an example of two other body systems that work together, and explain how they support each other.
Which is the graph of 3y-5x>-6
How did US involvement in Vietnam impact the nation during the 1960s?
HOW did the change in breast plates and helmets contribute to the decline of rome
A circle is inscribed in a square with a side length of 12 cm. What is the area of the square not contained within the circle? Use π=3.14 .