For my code, i need to make different columns with a row of random numbers, which i got, but am having troubles with seperating the rows into each column. I cannot use Numpy as part of my task
the code i got:
import random
low = 0
high = 100
cols = 5
rows = 3
x = [random.choices(range(low,high), k=cols) for i in range(rows)]
print(x)
what comes out:
[[37, 90, 78, 73, 15], [68, 42, 24, 71, 97], [12, 49, 75, 95, 31]]
what i need: (also to remove the marked square brackets)
([)[37, 90, 78, 73, 15]
[68, 42, 24, 71, 97]
[12, 49, 75, 95, 31](])
New contributor
Dead mem2020 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.