List Special Operation  in Python


We can perform concatenation using + operator, multiplication, or repetition using *  and spiting element of the list using [:] .which has been described by the following example.



a=[1,2,3,7,8,1]
del(a)
b=[4,5,6]
c=a+b
print(c)
c=a*3
print(c)

print(a[1:3])
print(a[1:])
print(a[:3])
print(a[-3:-1])


Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post