How to put a list within a chain [closed]

-1

I would like to add a list to a string, making it look like this:

alumnos = [["Juan", "Silvia"], ["María", "Luisa"], ...]

I do not know exactly how to do it in python.

    
asked by Spurring 03.12.2017 в 18:52
source

2 answers

1

You can do it directly with the append method using another list.

alumnos.append(["Otro", "Nombre"])
    
answered by 03.12.2017 / 18:56
source
0

Simpler is declaring the list as a variable and then using print () to display it:

alumnos = [["Juan", "Silvia"], ["María", "Luisa"], ...]
print("Lista de alumnos:" + alumnos)
    
answered by 04.12.2017 в 00:22