I would like to append append an item more than once. e.g
listA = ['AS','23','45']
listB = ['TH','67','78']
listB.append(listA.pop()*3)
print(listA)
# ['AS', '23']
print(listB)
#['TH', '67', '78', '454545']
on printing listB, it currently gives me the above list
but i want it to give me # ['TH', '67', '78', '45','45','45'] instead
How can i do this.
Try using
list.extend()and repeating not the string returned bypop(), but a single-element list: