how to add words separated by letters to an arrangement

2
n = int(input())
m = int(input())


matrix =[]
for i in range(n):
   matrix.append([])
   for e in range(m):
      matrix[i].append("")

so I make my arrangement

Now I want to add letters in each position as I can.

Example:

entry

  

asd

     

dsa

     

qwe

exit

  

[['a', 's', 'd'], ['d', 's', 'a'], ['q', 'w', 'e']]

    
asked by Victor Nunez 08.03.2017 в 15:39
source

1 answer

0

In this way, you would be asking the user to enter a word m times, converting each one into a list, and then get each character up to n -th.

for i in range(m):
    palabras = input()
    guia = list(palabras)
    for j in range(n):
        matrix[i][j] = guia[j]
    
answered by 08.03.2017 в 18:27