December 20, 2022
Estimated Post Reading Time ~ < 1 Min

10 python one-liners everyone should know

10 python one-liners everyone should know

1. Anagram
.com/media/

2. Binary to decimal

.com/media/


3. Converting string to lower case
.com/media/



4. Converting string to upper case
.com/media/



5. Converting string to byte
.com/media/


6. Copy files
.com/media/


7. Quicksort 
qsort = lambda l : l if len(l)<=1 else qsort([x for x in l[1:] if x < l[0]]) + [l[0]] + qsort([x for x in l[1:] if x >= l[0]])

8. Sum of n consecutive numbers
.com/media/


9. Swap two values
.com/media/


10. Factorial of a number

.com/media/


aem4beginner.blogspot


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.

Ad Blocker Detected :(

Please consider supporting us by disabling your ad blocker.

Please Disable your adblocker and Refresh the page to view the site content.