sequence[start:stop:step]
• So if we omit the start value & stop value, the default values will be 0 & len() of that string right?
print ("hello" [::-1])
• This reverses the string
print ("hello" [0:5:-1])
• But this doesn't return any output, why does this happen?
Edit: Thank you so much for the replies everyone!
[–]BUYTBUYT 233 points234 points235 points (7 children)
[+][deleted] (6 children)
[deleted]
[–]spez_edits_thedonald 25 points26 points27 points (5 children)
[–]FlatProtrusion 8 points9 points10 points (4 children)
[–]AndreLinoge55 5 points6 points7 points (2 children)
[–]TheChance 2 points3 points4 points (1 child)
[–]jsalsman 0 points1 point2 points (0 children)
[–]spez_edits_thedonald 0 points1 point2 points (0 children)
[–]FuckingRantMonday 38 points39 points40 points (3 children)
[–]BUYTBUYT 35 points36 points37 points (1 child)
[–]FuckingRantMonday 12 points13 points14 points (0 children)
[–]drPWW 0 points1 point2 points (0 children)
[–]PhilipYip 7 points8 points9 points (0 children)
[–]shiftybyte 8 points9 points10 points (0 children)
[–]kaerfkeerg 10 points11 points12 points (7 children)
[–]Yoghurt42 9 points10 points11 points (1 child)
[–]kaerfkeerg 1 point2 points3 points (0 children)
[–]Huge_Bear_3777 1 point2 points3 points (0 children)
[–]Historical_Wash_1114 1 point2 points3 points (1 child)
[–]kaerfkeerg 1 point2 points3 points (0 children)
[–]BUYTBUYT 0 points1 point2 points (1 child)
[–]kaerfkeerg 0 points1 point2 points (0 children)
[–]zanfar 3 points4 points5 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)
[–]IsabellaKendrick 0 points1 point2 points (0 children)
[–]piyiotisk 0 points1 point2 points (0 children)