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*

3
  • \$\begingroup\$ You can shave off a few characters if you append ;s=sorted to the first line and then replace the two instances of sorted with s in the second line. Should save... 3 characters? \$\endgroup\$ Commented Aug 6, 2015 at 17:58
  • 1
    \$\begingroup\$ Indeed. Python 3 also saves a bit of space, and is probably reasonable to use now, 5 years after this answer was posted. Also, the .strip() was redundant, given the specified inputs. \$\endgroup\$ Commented Aug 10, 2015 at 12:55
  • \$\begingroup\$ Yeah, sorry. I didn't notice how old this question was when I commented, only that it was on the frontpage. ^^; \$\endgroup\$ Commented Aug 10, 2015 at 22:39