>>> alist = [["H"]]
>>> mylist = alist[0].append([2])
>>> print(mylist)
>>>
As you can see it prints nothing. I'm trying to get this as the result.
>>> [["H", [2]]]
Any help?
>>> alist = [["H"]]
>>> mylist = alist[0].append([2])
>>> print(mylist)
>>>
As you can see it prints nothing. I'm trying to get this as the result.
>>> [["H", [2]]]
Any help?
.append()
actually appends to the existing list, it does not return a new list:
alist = [["H"]]
alist[0].append(2)
print( alist )