+ 1

Explain the output

a="game of dice" print (a[::-3]). Output is : edom. How?

30th Apr 2017, 6:59 AM
Sumit Saurabh
Sumit Saurabh - avatar
3 Answers
+ 6
If you take a look e which has a value of 3 in the string and it takes 3 steps to go to d, 3 steps from d to e and lastly lets say its "game of dicegame of dice" as you can see there first e in the word game in the first "game of dice" it takes 3 steps for it to go to m to the second string
30th Apr 2017, 7:16 AM
Complex
Complex - avatar
+ 5
Anytime :)
30th Apr 2017, 7:18 AM
Complex
Complex - avatar
+ 1
Got it :) thanks
30th Apr 2017, 7:18 AM
Sumit Saurabh
Sumit Saurabh - avatar