Skip to main content
10 events
when toggle format what by license comment
Apr 24, 2020 at 6:53 history edited Ry- CC BY-SA 4.0
top python answer counts like this
Apr 24, 2020 at 6:39 history edited Ry- CC BY-SA 4.0
golf
Dec 28, 2015 at 22:56 history edited Ry- CC BY-SA 3.0
Use Steven Rumbalski’s character comparison (thank you!). Doesn’t use the loop despite that saving one character so that it can count 51 by @Lego’s metric
Oct 8, 2013 at 18:56 comment added Steven Rumbalski Very nice. Beat my unposted 62 length solution for c in input():print([c,(chr(ord(c)+32))]['@'<c<'['],end=''). I tried some with the map(ord,input()) trick, but missed the multiplying the truth value by 32 and adding it to the character code trick. Very nice.
Oct 7, 2013 at 5:55 comment added user8777 Your answer follows the spirit of the question, but mine follows the letter of the question...
Oct 6, 2013 at 18:25 comment added asteri Got it. Thanks for the explanation!
Oct 6, 2013 at 18:21 comment added Ry- @JeffGohlke: map applies a function (in this case, ord) to an interable and returns an iterable. It’s like a shorter form of (ord(x) for x in input()).
Oct 6, 2013 at 17:34 comment added asteri Can you explain how this works? I'm really interested in getting better at Python. I don't get how the map(ord,input()) bit works.
Oct 6, 2013 at 16:52 review Low quality posts
Oct 6, 2013 at 17:42
Oct 6, 2013 at 16:33 history answered Ry- CC BY-SA 3.0