Answer the question
In order to leave comments, you need to log in
How to execute a function multiple times?
It is necessary that this function be executed a certain number of times (the user himself enters) and the number is written to the array. How can I do that?
def number():
for number in chek:
new_el = number.split(':')
num = random.randint(int(new_el[0]), int(new_el[1]))
return num
Answer the question
In order to leave comments, you need to log in
?
Or stop, in what array?
results = []
iterations = int(input())
for _ in range(iterations):
result = number()
results.append(result)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question