>>> Ls=['p', 'r','o', '1', 'e','m']
>>> L3(2:3=(1
>>> print ("LS")
>>> Ls [2:5)=[]
>>> print ("Ls")
Answers
Answered by
1
a) L3[2:3] :
out: ['r']
b) print ("LS"):
out: LS
c) Ls [2:5)
out: ['r','o','1']
d)print ("Ls")
out : Ls
Explanation:
a) returns a sliced list from index 2 to (3-1) which is same as index 2 only.
b) Prints the string.
c) returns a sliced list from index 2 to (5-1).
d) Prints the string.
Similar questions