0
How we can print 2D array without brackets & commas and what is the way to format them.
For example: We have an array like: [[ 1, 2, 3] [4, 5, 6] [7, 8, 9]] Want to be printed like this: 1 2 3 4 5 6 7 8 9
7 Answers
+ 2
I think these codes can help you:
for r in range(len(d)): # rows
for c in range(len(d[r])): # columns
print (d[r][c], " ", sep="", end="")
print()
https://code.sololearn.com/clDbt6xx58vB
+ 4
Rupali attempt.......???
+ 4
Since you don't wanna try, I'll say that '*' can be used for more than multiplication.
+ 2
# try this
d = [[ 1, 2, 3], [4, 5, 6], [7, 8, 9]]
for a in d:
print (*a)
https://code.sololearn.com/clDbt6xx58vB
+ 1
In python
+ 1
Thank you đit helped me alot
0
How we can use formatting to do the same..because for that also we need to access each element in the array