elena1234

multidimensional array in Python

Feb 16th, 2022 (edited)
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. x = int(input())
  2. y = int(input())
  3.  
  4. row = x
  5. col = y
  6.  
  7. array = [[0] * col for r in range(row)]
  8.  
  9. for r in range(len(array)):
  10.     for c in range(len(array[r])):
  11.         array[r][c] = r * c
  12.  
  13. print(array)
  14.  
Add Comment
Please, Sign In to add comment