Skip to content

Commit c8afb00

Browse files
authored
Merge pull request #11 from bendikMichal/master
Update one_liners.py - rot-13 converter
2 parents 0616a4d + 5ea294f commit c8afb00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

one_liners.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
# print a love emoji with a give name, here it prints my username (Zenoftech) https://github.com/zenoftech
5353
print('\n'.join([''.join([('Zenoftech'[(x-y)%9 ]if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3<=0 else' ') for x in range(-30,30 )])for y in range(15, -15, -1)]))
5454

55+
# Get back rot-13 version of text you enter
56+
(lambda x, a = "abcdefghijklmnopqrstuvwxyz", b = "ABCDEFGHIJKLMNOPQRSTUVWXYZ": "".join([a[a.index(x[i]) - 13] if x[i] in a else b[b.index(x[i]) - 13] if x[i] in b else x[i] for i in range(len(x))]))(input("Enter text: "))
57+
5558
# General One-Liner Commands From https://gist.github.com/craigls/2712084
5659
'''
5760
Some useful Python one-liners taken from http://www.reddit.com/r/Python/comments/fofan/suggestion_for_a_python_blogger_figure_out_what/

0 commit comments

Comments
 (0)