Python – concatenate NoneType and string in a new list

to add items to a list you want to use the append method:

my_list = []
a = None
b = 'apple,banana,cherry'

# adds a to the list
my_list.append(a)

# adds b to the list
my_list.append(b)

Browse More Popular Posts

Leave a Comment