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

Find all values of θ in the interval 0° ≤ θ < 360° that satisfy the equation sin 2θ = sin θ.
Write y = 2x2 + 4 in function notation. A) f(x) = 2x2 + 4 B) f(y) = 2x2 + 4 C) f(y) = 2y2 + 4 D) f(x) = 2y2 + 4
The distributive property helps us simplify an expression by using multiplication over addition to remove the ______________.
Solve this equation: 7x-1=3y+8
Main Show Tank Calculation: The main show tank has a radius of 60 feet and forms a quarter-sphere. What is the volume of the quarter-sphere shaped tank? Round
7. In at least three complete sentences, write a character analysis for the protagonist in your selected novel. Include literal, interpretive, and evaluative in
what stores the waste until it is ready to be expelled from the body?
The presence of the disease sickle cell anemia illustrates that natural selection does not always eliminate _________ alleles.
A desk is on sale for $307.20 which is 68% less than the regular price. What is the regular price
Sandra is riding a bicycle at 10.0 meters/second. She slows down to 2.0 meters/second in 10 seconds. Her acceleration is __ meters/second2.