Code 19: 2D Integer Array Input in Python | Array Input Python | 365 days of code

Publicado em: 19 Janeiro 2021
no canal de: Code House
422
1

Python program to take Integer input in 2D Array.

Complete playlist for different ways of input in the array as asked in coding questions:    • Array Input in Python  

Code -
"""
Input Format
R C (Number of Rows and Columns)
Value11 Value12 Value13 ......
Value21 Value22 Value23 ......
Value31 Value32 Value33 ......
....... ....... ....... ......

Sample Input:
4 2
50 51
60 61
70 71
80 81
"""
Taking value of R and C
R_and_C = input().split() # "4 2"
R = int(R_and_C[0]) # 4
C = int(R_and_C[1]) # 2, but we will not use value of C

values = []
for i in range(R):
value_input = list(map(int, input().split())) # Splitting the string to array (Space Separated), then converting each element from string to integer.
values.append(value_input)
print(values)


Nesta página do site você pode assistir ao vídeo on-line Code 19: 2D Integer Array Input in Python | Array Input Python | 365 days of code duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Code House 19 Janeiro 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 422 vezes e gostou 1 espectadores. Boa visualização!