adamcookie26 adamcookie26
  • 20-11-2020
  • Computers and Technology
contestada

python code 100 Random Numbers (twice)

python code

instructions:
You need to write code that will print two bricks of numbers, one with integers, one with decimals.

Respuesta :

Cytokine
Cytokine Cytokine
  • 20-11-2020

import random

i = 1

while i <= 100:

   print("#"+str(i)+": "+str(random.randint(1,100)), end=", ")

   i+=1

print()

i = 1

while i <= 100:

   print("#"+str(i)+": "+str(random.uniform(1,100)), end=", ")

   i += 1

I hope this helps!

Answer Link

Otras preguntas

What is greater and why 2/3 or 5/6 or 7/9
A straight fence is to be constructed from posts 6 inches wide and separated by lengths of chain 5 feet long. If a certain fence begins and ends with a post, wh
Write the following expression in terms of sine and cosine, and simplify so that no quotients appear in the final expression. sec x - cos x
a+5=-5a+5 how do I solve this?
Reptiles include which of the following? (1) crocodiles, (2) lizards, (3) snakes, (4) turtles. a. 1 and 2 b. 3 and 4 c. 1, 2, and 3 d. 1, 2, 3, and 4
At a speed of 22 revolutions per minute, how long will it take a wheel of radius 10, rolling on its edge, to travel 10 feet? (Assume p equals 22/7, and express
2m+3=m-3 how do you do this problem?
which armies had increased in size between 1870 and 1914
What is the simplified result of following the steps below in order? (1) add 5y to 2x (2) multiply the sum by 3 (3) subtract x + y from the product
Reptiles include which of the following? (1) crocodiles, (2) lizards, (3) snakes, (4) turtles. a. 1 and 2 b. 3 and 4 c. 1, 2, and 3 d. 1, 2, 3, and 4