+ 6

Python shortcuts

I want to know how to reduce the codes into single line or into a small chunks which can be only in python..

11th Oct 2018, 3:58 PM
Abhijith Sheheer
Abhijith Sheheer - avatar
11 Respuestas
+ 12
Check out VcC's and Cépagrave's codes to see how it's done ;)
11th Oct 2018, 5:31 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
11th Oct 2018, 9:45 PM
Cépagrave
Cépagrave - avatar
+ 17
https://code.sololearn.com/c4a6gDBCnZac/?ref=app
11th Oct 2018, 9:46 PM
Cépagrave
Cépagrave - avatar
+ 5
remember, one-liner is only for learning and for fun, never to do it at your workplace https://code.sololearn.com/cZGiT4dCgn54
12th Oct 2018, 4:01 PM
Flandre Scarlet
Flandre Scarlet - avatar
+ 4
If you could ignore please the extra statements just to show what I was doing (dumping structures)... Here's something I over-engineered: https://code.sololearn.com/cNUY5Q0bACDc/?ref=app My only excuse: I was forcing myself to use language features like 'chain' but the end result wasn't very approachable. Take a look at Cépagrave's response. It's nice. https://code.sololearn.com/ckkM7Z5jNaLy/?ref=app
12th Oct 2018, 7:10 PM
Kirk Schafer
Kirk Schafer - avatar
+ 3
Thanks God, I thought I am crazy and code sick guy but you guys (VcC and Cépagrave) are make me feel I am normal. Thanks for sharing your experiences.
12th Oct 2018, 4:11 PM
Ahmed Bahaddin
Ahmed Bahaddin - avatar
+ 3
according to me you should use inbuilt function it will reduce the code size
12th Oct 2018, 4:25 PM
Chaman Yadav
Chaman Yadav - avatar
+ 1
how to start py.games on Python plz guide me
12th Oct 2018, 5:35 PM
shakeel ahmad
12th Oct 2018, 5:37 PM
Flandre Scarlet
Flandre Scarlet - avatar
0
There are great tools like list comprehension, lambdas, methods and etc that are only available in python. I am intrested in this subject too. I send 2 codes from code couch problems that i solved in one line. https://code.sololearn.com/c2k1ymzLoj9n/?ref=app https://code.sololearn.com/ceMN9dKxb2lm/?ref=app
26th Dec 2019, 9:38 AM
Mahdi Rostami
Mahdi Rostami - avatar