ZN Code Saves
20 subscribers
2 photos
2 links
Code snippets and programming notes.

For testing bots and scripts, please join: @botspamdebug

More from ZN: @z_network
Download Telegram
Language:
py3


Source:
X, Y, Z, V = 'burgers', 'burger', None, 'burger'
print('yo dawg, I herd you like {}, so I put a {} in your {} so you can {} while you {}'.format(X, X if not Y else Y, (X if not Y else Y) if not Z else Z, X if not V else V, X if not V else V))


Result:
yo dawg, I herd you like burgers, so I put a burger in your burger so you can burger while you burger
Language:
py3


Source:
q,r,L=abs,print,' ℒ'
class LonamiPity:
def __init__(s,b):s.b=b;
def withdraw(s,a):return'No withdrawals!';
def deposit(s,a):a=q(a);s.b+=a;return'Deposited:'+L,a;
def bal(s):return'Balance:'+L,s.b;
p=LonamiPity(20);r(p.withdraw(10));r(*p.deposit(25));r(*p.bal());


Result:
No withdrawals!
Deposited: ℒ 25
Balance: ℒ 45
Language:
py3


Source:
q,r,L,N=abs,print,' ℒ','\n'
class LonPity:
def __init__(s,b):s.b=b
def w(s,a):return'Cant withdraw',L,a,'!',N
def d(s,a):a=q(a);s.b+=a;return'Deposited:'+L,a,N
def c(s):return'Balance:'+L,s.b,N
p=LonPity(100);r(*(*p.c(),*p.w(40),*p.d(25),*p.c()),sep='')


Result:
Balance: ℒ100
Cant withdraw ℒ40!
Deposited: ℒ25
Balance: ℒ125
Language:
py3


Source:
q,r,L,N=abs,print,' ℒ','\n'
class LP:
def __init__(s,b):s.b=b;r('LonaPity')
def w(s,a):return"Can't w/d",L,a,'!',N
def d(s,a):a=q(a);s.b+=a;return'Deposited:'+L,a,N
def c(s):return'Balance:'+L,s.b,N
p=LP(100);r(*(*p.c(),*p.w(40),*p.d(25),*p.c()),sep='')


Result:
LonaPity
Balance: ℒ100
Can't w/d ℒ40!
Deposited: ℒ25
Balance: ℒ125
Language:
py3


Source:
e_dict={"🖨":"print"}

emojithon="🖨('hello world')"

decoded=''.join([(x if x not in e_dict else e_dict[x]) for x in emojithon])

eval(decoded)


Result:
hello world
Language:
py3


Source:
awberry = "🍓"

print(str(awberry))


Result:
🍓
Language:
py3


Source:
emojis='❤️ 🧡 💛 💚 💙 💜'

print(''.join(__import__('random').choice([x[0] for x in emojis.split(' ')]) for _ in range(60)))


Result:
💙💜💛💛💚💙💜🧡💙💛💜🧡💙💙🧡💛💙💙💛💛💜💙💙💙💛💚💚💜🧡💜💚💜💜💛💛💜💙💙💙💚💜💛🧡💙💛💛💚🧡💙💙
Language:
py3


Source:
code="def main():\n  print(gethi())\ndef gethi():\n  return'hi'\nif __name__=='__main__':main()"
exec(code)


Result:
hi
Language:
py3


Source:
import keyword as k
w=k.kwlist+['print','\"','\'','(',')',':','=']
e='🚫🔜💔🏫📘🙃🙄😱😅🌐🤔🚢👽💨🙋🔙🔃🔀🔺🖨'
d,i={},0
for j in e:
d[j]=w[i];i+=1
print(d)


Result:
{'🙃': 'elif', '': 'in', '': 'or', '': 'continue', '': 'is', '🏫': 'class', '': 'from', '': 'lambda', '💔': 'break', '🙄': 'else', '': 'try', '': 'True', '🌐': 'global', '🔀': 'with', '🔜': 'as', '': 'del', '': 'not', '🚫': 'None', '': '(', '': 'and', '': "'", '🖨': 'print', '🔺': 'yield', '': ')', '📘': 'def', '': '=', '🔃': 'while', '': 'for', '😅': 'finally', '': 'assert', '': 'False', '🚢': 'import', '🙋': 'raise', '👽': 'nonlocal', '💨': 'pass', '😱': 'except', '': '"', '🤔': 'if', '': ':', '🔙': 'return'}
Language:
py3


Source:
import keyword as k
w=k.kwlist+'print " \' ( ) : = \n'.split(' ')
e='🚫🔜💔🏫📘🙃🙄😱😅🌐🤔🚢👽💨🙋🔙🔃🔀🔺🖨🆕'
d,i={},0
for j in e:
d[j]=w[i];i+=1
n='📘 m🆕 🖨hi🆕🤔 __name____main__🆕 m'
exec(''.join([(x if x not in d else d[x]) for x in n]))


Result:
"hi"
Language:
py3


Source:
print('👩‍🎓'.strip('🎓'))


Result:
👩
Language:
py3


Source:
print('\n'.join('{0} bottles of beer on the wall, {0} bottles of beer, you take one down and pass it around, {1} bottles of beer on the wall'.format(i, i-1) for i in (range(99, 97,-1))))


Result:
99 bottles of beer on the wall, 99 bottles of beer, you take one down and pass it around, 98 bottles of beer on the wall
98 bottles of beer on the wall, 98 bottles of beer, you take one down and pass it around, 97 bottles of beer on the wall
Language:
py3


Source:
s='\u0336'
def striketext(string):
return s.join([*string,''])

print(striketext("this text is striked"))


Result:
t̶h̶i̶s̶ ̶t̶e̶x̶t̶ ̶i̶s̶ ̶s̶t̶r̶i̶k̶e̶d̶
Forwarded from Zac
Language:
py3


Source:
import random as r
c = {1:"",2:"",3:"",4:"💣",5:"",6:""}
print('russian roulette:\n*spin*\n*click*\n')
print("*bang*\n*ded*" if not c[r.choice(list(c.keys()))] == "" else ":) *yolo*")


Result:
russian roulette:
*spin*
*click*

:) *yolo*
Forwarded from Zac
Language:
py3


Source:
import random as r
c = {1:"",2:"",3:"",4:"💣",5:"",6:""}
print('russian roulette:\n*spin*\n*click*\n')
print("*bang*\n*ded*" if not c[r.choice(list(c.keys()))] == "" else ":) *yolo*")


Result:
russian roulette:
*spin*
*click*

*bang*
*ded*
Language:
py3


Source:
o,h,e,q,c,k='•','<','no he*cks given.',7,13,'—';d=['⠀']*c;v=['']*q;p=[[i for i in d] for j in v];p[0][6]=p[1][3]=p[1][9]=p[3][1]=p[3][11]=p[5][0]=p[5][6]=p[5][12]=o;p[5][2]=h;p[5][3]=p[5][4]=p[5][5]=k;
print(*[''.join(x) for x in p],e, sep='\n')


Result:
⠀⠀⠀⠀⠀⠀•⠀⠀⠀⠀⠀⠀
⠀⠀⠀•⠀⠀⠀⠀⠀•⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀•⠀⠀⠀⠀⠀⠀⠀⠀⠀•⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
•⠀<———•⠀⠀⠀⠀⠀•
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
no he*cks given.
Language:
py3


Source:
o,h,e,q,c,k='🔹','◁','no he*cks.',7,13,'—';d=['⠀']*c;v=['']*q;p=[[i for i in d] for j in v];p[1][6]=p[2][2]=p[2][9]=p[3][1]=p[3][10]=p[4][0]=p[4][11]=p[5][0]=p[5][10]=o;p[5][2]=h;p[5][3]=p[5][4]=p[5][5]=k;p[5][6]='▫️'
print(*[''.join(x) for x in p],e, sep='\n')


Result:
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀🔹⠀⠀⠀⠀⠀⠀
⠀⠀🔹⠀⠀⠀⠀⠀⠀🔹⠀⠀⠀
🔹⠀⠀⠀⠀⠀⠀⠀⠀🔹⠀⠀
🔹⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀🔹
🔹⠀◁———▫️⠀⠀⠀🔹⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
no he*cks.
Language:
py3


Source:
h,t,g,o,s,n= ['🍺', '🍪', '🌮'],'🗑️','< (^_^ <)','(> ^_^) >','⠀','\n\n';d=len(h)
for i in reversed(range(d)):
z=[[*h,s,g,s,t],[*h,g,s,s,t],[*h[:i],o,h[i],s,t],[*h[:i],s,o,h[i],t],[*h[:i],s,s,o,t],[*h[:i],s,s,g,t]];print(*[''.join(x) for x in z],sep=n);h[i]=''


Result:
🍺🍪🌮⠀< (^_^ <)⠀🗑️

🍺🍪🌮< (^_^ <)⠀⠀🗑️

🍺🍪(> ^_^) >🌮🗑️

🍺🍪⠀(> ^_^) >🌮🗑️

🍺🍪⠀⠀(> ^_^) >🗑️

🍺🍪⠀⠀< (^_^ <)🗑️
🍺🍪⠀< (^_^ <)⠀🗑️

🍺🍪< (^_^ <)⠀⠀🗑️

🍺(> ^_^) >🍪🗑️

🍺⠀(> ^_^) >🍪🗑️

🍺⠀⠀(> ^_^) >🗑️

🍺⠀⠀< (^_^ <)🗑️
🍺⠀< (^_^ <)⠀🗑️

🍺< (^_^ <)⠀⠀🗑️

(> ^_^) >🍺🗑️

⠀(> ^_^) >🍺🗑️

⠀⠀(> ^_^) >🗑️

⠀⠀< (^_^ <)🗑️
s/(?<![ls ])c(?![hkt ])|s/th/gi