2
def annexsentence():
nome_tarefa=input("Nome da Tarefa :")
data_atual = datetime.datetime.now().strftime("%d-%m-%y")
data_final=input("Data Final :")
estado="Aberta"
lista=[nome_tarefa,str(data_atual),str(data_final),estado]
annexsentence=open("ficheiro2.txt","a")
annexsentence.write(str(lista)+"\n")
annexsentence.close()
annexsentence()
Good evening, I would like to know how to put this list I have already created inside another list getting for example:
[[lista1,lista1,lista1,],[lista2,lista2,lista2,],[lista3,lista3,lista3,]]
so that you can always add a new list within it
The variable
lista
is the second dimension right? And what is the list of the first dimension? Each dimension is a level, a dimension:[1,2,3]
, two-dimensional:[[1,2,3],[1,2,3],[1,2,3]]
, ...– Costamilam
i want to create an empty list for example list=[] and within the list put a 2 list with for example the [1,2,3],[1,2,3],[1,2,3] to stay [[1,2,3],[1,2,3],[1,2,3]]
– Pedro Pinheiro
@Pedropinheiro The solutions of the question must be in the answer area, not the question itself. If you have managed to solve the problem in a different way than those already addressed in the answers, feel free to answer your own question.
– Woss