1 Line Code [Challange] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

1 Line Code [Challange]

what can you do with just One and only One line of code.

14th Feb 2018, 2:44 AM
Nikhil
Nikhil - avatar
10 Answers
+ 6
heres my biggest 1 liner... it prints all subsets even with all permutation... only basic keywords used... https://code.sololearn.com/cZ41Ge58z6zk/?ref=app
14th Feb 2018, 2:54 AM
sayan chandra
sayan chandra - avatar
+ 8
here I count vowels in input: https://code.sololearn.com/cTL8373r1y9L/?ref=app but much more can be done :p
14th Feb 2018, 3:44 AM
Pedro Demingos
Pedro Demingos - avatar
14th Feb 2018, 4:24 AM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
+ 4
You can put everything in a single line. (exept for single line comments...) Readability is just at -5/10 So whole games could fit into a single line...
14th Feb 2018, 11:57 AM
D B
D B - avatar
31st Dec 2018, 2:51 AM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
+ 2
https://code.sololearn.com/cdq7Vcbzjt6A/?ref=app
31st Dec 2018, 2:51 AM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
22nd Dec 2018, 3:19 AM
Juan Prieto
Juan Prieto - avatar
+ 1
https://code.sololearn.com/cu1io5pwFdBf/?ref=app
29th Dec 2018, 10:46 PM
Juan Prieto
Juan Prieto - avatar
0
My first one-liner: https://code.sololearn.com/ciSxUtF2L9H4/?ref=app I wrote it with the knowledge SoloLearns Python-tutorial gives from its start to the using of range(). Now, after learning more Python, I understand there would have been also easier ways, but this is my first one-liner. And the only one, for now.
29th Dec 2018, 9:54 AM
Joel Kronqvist
Joel Kronqvist - avatar
0
Juan Prieto Isn't that a little cheating? I mean, in a pure one-liner there shouldn't be more than one line, and depending on language, one semicolon, I guess. Of course you cant do it like that in Java, but I think there should be only one "fair" line of code in the main-class, when using programming languages as Java, C, C++, C#...
29th Dec 2018, 9:56 AM
Joel Kronqvist
Joel Kronqvist - avatar