3.0k views
3 votes
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.

User Loreen
by
5.7k points

1 Answer

3 votes

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!

User Kelly Bang
by
5.0k points