Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    \$\begingroup\$ You can remove both instances of 0 \$\endgroup\$ Commented Aug 3, 2016 at 16:53
  • \$\begingroup\$ Good catch! Thanks, updated @LeakyNun \$\endgroup\$ Commented Aug 3, 2016 at 16:54
  • 1
    \$\begingroup\$ Huh? len(s)/2? Why not 26? \$\endgroup\$ Commented Aug 3, 2016 at 17:00
  • \$\begingroup\$ Good catch! @manatwork \$\endgroup\$ Commented Aug 3, 2016 at 17:04
  • 1
    \$\begingroup\$ See and apply marcog's tip from Tips for golfing in Python: print[s[:-i-1]+s[-i-3::-1],s[:i]+s[i::-1]][26>i]. \$\endgroup\$ Commented Aug 3, 2016 at 17:09