Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
string slicing
-
Hi all!
I get an error in Pythonista, but not in Idle on desktop
S = 'abcedfghijklm'
print S[5:1:−1]What seems to be the problem here?
-
I'm not getting an error here, it prints
fedc
, as expected. What kind of error do you get? -
Your -1 has a dash character instead of a minus sign character. If you change it to a minus sign then the world will become a better place.
-
@ccc Thanx a lot. I must have copied it from somewhere unexpecting a dash instead of a minus. Well, lesson learned. The traps lurking behind an innocent facade...