Reputation: 38
This should append the values in the list val from the new list I am creating here using range method.
val = [1, 2, 3,'time is', 10, 'up']
print val.extend(range(0,10))
Upvotes: 0
Views: 55
Reputation: 1121962
list.extend()
extends the list object in place and returns None
.
You can print val
after extending:
val.extend(range(0,10))
print val
or use concatenation:
print val + range(0, 10)
Upvotes: 5