list1 = ["a", "b", "c"]
list2 = list1.append("d")
print(list2)
this output None.Don't know why?
list3 = ["a", "b", "c"]
list3.append("d")
list4 = list3
print(list4)
this correct and output ['a', 'b', 'c', 'd']
list1 = ["a", "b", "c"]
list2 = list1.append("d")
print(list2)
this output None.Don't know why?
list3 = ["a", "b", "c"]
list3.append("d")
list4 = list3
print(list4)
this correct and output ['a', 'b', 'c', 'd']
You have to do it this way:
list1 = ["a", "b", "c"]
list1.append("d")
list2 = list1
print(list2)
This answer explains why very well:
https://stackoverflow.com/questions/20016802/why-does-list-append-return-none/#answer-20016976