0
position = 0
tasks = []
task = [task1,year,month,day, hour, minute, second, microsecond,str(cuando),cuando]# this is a list that is filed into another list#
while k < CantTareas :
    ans = raw_input ("did you finish any of your tasks? (yes or no) ")
    if ans == "yes":
        k = k + 1
        position = input ("which task position did you finish? ")
        print "the task that you finished is : ",tasks [position] [0],
        tasks [posicion][0]= "finished"
        taskList = '\n'.join(str(tarea) for tarea in tareas)
        print taskList ,  "define una lista "
    else:
        taskstoGo = '\n'.join(str(task) for task in tasks)
    # instead of printing finished on the list I want to eliminate it from the list. #  

the program prints

[["math",year,month,day, hour, minute, second, microsecond,str(cuando),cuando]
    [finished,year,month,day, hour, minute, second, microsecond,str(cuando),cuando]

if you type yes, I want it to print only:

[["math",year,month,day, hour, minute, second, microsecond,str(cuando),cuando]]

2
Contributors
1
Reply
21
Views
3 Years
Discussion Span
Last Post by snippsat
0
>>> lst = [[1,2,3], [4,5,6]]
>>> del lst[1]
>>> lst
[[1, 2, 3]]

>>> lst = [[1,2,3], [4,5,6]]
>>> lst.remove(lst[1])
>>> lst
[[1, 2, 3]]

>>> lst = [[1,2,3], [4,5,6]]
>>> lst.pop(1)
[4, 5, 6]
>>> lst
[[1, 2, 3]]
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.