InterviewSolution
Saved Bookmarks
| 1. |
>>> Ls=['p', 'r','o', '1', 'e','m'] >>> L3(2:3=(1>>> print ("LS")>>> Ls [2:5)=[]>>> print ("Ls") |
|
Answer» :3] :out: ['R']b) print ("LS"):out: LSc) Ls [2:5) out: ['r','o','1']d)print ("Ls")out : LsExplanation: 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. |
|