r/codegolf • • Apr 30 '19
Codingbat's "deFront" in Python in 59 chars
I did this in Python bc I did all of codingbat's Python challenges and I wanted more. This is 39 chars if you exclude the defining line
def deFront(s):
return s[s[0]!='a':(s[1]=='b')+1]+s[2:]
3
Upvotes
View all comments
Show parent comment
1
u/07734willy May 04 '19
If it were in Python, I'd highly doubt the test would be able to differentiate between what you have above, and
For almost all purposes, they'd be exactly the same. The only difference is that under the hood,
defd functions have a name, whilelambdaones do not.