-
-
Save codecakes/d4c66a997d80b01810e5fbb6d20100ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = [1,2,3] | |
if len(x) < 3: | |
return x | |
else: | |
return [4,5,6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
x = [1,2,3] | |
if len(x) < 3: | |
print(json.dumps(x)) | |
else: | |
print(json.dumps([4,5,6])) |
It is imp to attack the hard challenge as early and learn the concept behind. Now I understand a few things about ast which generally I have not come across!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, here is a solved snippet:
which gives: