LOYOLITE
If you're gonna shoot, shoot!, Don't talk.!
Friday, May 25, 2018
Concatenating and combining lists in Python
CODE:
[4, None, 'foo'] + [7, 8, (2, 3)]
or
x = [4, None, 'foo']
x.extend([7, 8, (2, 3)])
print(x)
OUTPUT:
[4, None, 'foo', 7, 8, (2, 3)]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment