+ 4
Slicing : [ startIndex, endIndex, stepCount] starting index is where it starting slicing. endIndex is not inclusive. endIndex-1 is the last index to slice. (optional) Step count is the number of steps to skip to next slice. (optional, default is 1) x="GREEN VEGGIES" print(x[1: :-1]) Start at index 1, till all, by -1 steps. (Negative count means backwards) get 1st index value, 1-1=0 index value, 0-1 is out of range stop Output : RG
12th Feb 2022, 5:01 PM
Jayakrishna 🇼🇳