How can i modify this code to make 3 lists with 5 elements in each instead of as it is now; 3 lists with 5/10/15 elements?
import random
y = []
def autoSolve():
for i in range(5):
z = random.randrange(1, 10)
y.append(z)
print(y, end="")
for i in range(3):
print("number", i + 1,)
autoSolve()
print()
Move y = []
into the autoSolve method, so that it's reset on every call.
def autoSolve():
y = []
for i in range(5):
z = random.randrange(1, 10)
y.append(z)
print(y, end="")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With