Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 560 Bytes

File metadata and controls

21 lines (12 loc) · 560 Bytes

025 two dimensional array

📝 Instructions:

  1. Create a function two_dimensional_array() which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j.

Example input:

two_dimensional_array(3,5)

Example output:

  • [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]]

💡 Hints:

  • i = 0,1.., X-1; j= 0,1, Y-1.

  • In case of input data being supplied to the question, it should be assumed to be a console input in a comma-separated form.