Skip to content

Instantly share code, notes, and snippets.

@Sunil-ghodela
Created August 23, 2019 16:29
Show Gist options
  • Save Sunil-ghodela/ff929cfce3507945de13ba4a1d67a197 to your computer and use it in GitHub Desktop.
Save Sunil-ghodela/ff929cfce3507945de13ba4a1d67a197 to your computer and use it in GitHub Desktop.
a = [[1, 2, 3, 4], [5, 6], [7, 8, 9]]
for i in range(len(a)):
for j in range(len(a[i])):
print(a[i][j], end=' ')
print()
@Sunil-ghodela
Copy link
Author

Sunil-ghodela commented Aug 23, 2019

a = [[1, 2, 3, 4], [5, 6], [7, 8, 9]] for i in range(len(a)): for j in range(len(a[i])): print(a[i][j], end=' ') print()

@Sunil-ghodela
Copy link
Author

Sunil-ghodela commented Aug 23, 2019

a = [[1, 2, 3, 4], [5, 6], [7, 8, 9]] for row in a: for elem in row: print(elem, end=' ') print()

@Sunil-ghodela
Copy link
Author

for row in a: print(' '.join([str(elem) for elem in row]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment