see: http://c4m.cdf.toronto.edu/cohort1/winte...tions.html
Specifically In [4]:
not with a slice, but same thing.
essentially nums[0] is considered an int, not a list
concatenate must be list + list, not list + int
so the following works:
Specifically In [4]:
not with a slice, but same thing.
essentially nums[0] is considered an int, not a list
concatenate must be list + list, not list + int
so the following works:
n = [1,2,3,4,5] n1 = n[3:]+n[4:] print(n1)