How to extend a list by appending all the elements of a tuple in Python

1 Answer

0 votes
lst = ["Python", "Java", "PHP"]
tpl = ("C", "C++", "C#")

lst.extend(tpl)

print(lst)


'''
run:

['Python', 'Java', 'PHP', 'C', 'C++', 'C#']

'''

 



answered Dec 4, 2017 by avibootz

Related questions

...