D
D
DimaD0106d2021-06-14 19:57:10
Python
DimaD0106d, 2021-06-14 19:57:10

How to make a for loop run multiple times?

Hello, I have such an algorithm:

import random
import time
for i in range(10):
a = random.randint(1,9)
print(a, end = '')

I want to have not one value, but many , I tried while True in such cases, I just have a bunch of numbers in a string, and I need each value from a new line to be.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-06-14
@DimaD0106d

Combine two loops

import random
import time
while True:
    for i in range(10):
        a = random.randint(1,9)
        print(a, end = '')
    print()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question