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:
from datetime import datetime as dt
print('go to bed' if dt.now().hour+1>22 else 'keep programmimg')


Result:
keep programmimg
import random
print(''.join(random.choices('ACGT', k=50)))
Language:
py3


Source:
print('lonami'[bool(not 'This sentence is False')+bool(not 'This sentence is False'):((bool('This sentence is False')+bool('This sentence is False'))*(bool('This sentence is False')+bool('This sentence is False')))*(bool(not '')+bool(not ''))])


Result:
lonami
rang=range(129350,129380)
rang2=range(129400,129430)
join = chr(8205)
arr=[]
for i in rang:
for j in rang2:
arr.append('{}{}{}'.format(chr(i), join, chr(j)))
print(''.join(arr))
print(''.join(map(chr, range(126989,129690))))
Language:
py3


Source:
X, Y, Z, V = 'ot groups', 'ot group', None, 'offtopic'
print('yo dawg, I herd you like {}, so I put an {} 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 ot groups, so I put an ot group in your ot group so you can offtopic while you offtopic
arr=[]
for i in range(126989, 129687):
arr.append(chr(i))
print(''.join(arr))
Language:
py3


Source:
print(*(chr(i) for i in (103,111,32,116,111,32,98,101,100)),sep='')


Result:
go to bed
Language:
py3


Source:
import random as r
o=[['chair','lawnmower'],['balcony','bridge'],['lava','antimatter']]

print('you need a slap in the face, with a {}, off of a high {}, into a pool of {}'.format(*map(r.choice, o)))


Result:
you need a slap in the face, with a chair, off of a high balcony, into a pool of lava
Language:
py3


Source:
print('Flipping coin...', '*fwoop fwoop*', '*ding ching ching ing*', "it's {}".format(__import__('random').choice(['heads.','tails.'])), sep='\n')


Result:
Flipping coin...
*fwoop fwoop*
*ding ching ching ing*
it's heads.
Language:
py3


Source:
[print(i,'sheep ๐Ÿ‘\n') for i in range(1,6)]


Result:
1 sheep ๐Ÿ‘

2 sheep ๐Ÿ‘

3 sheep ๐Ÿ‘

4 sheep ๐Ÿ‘

5 sheep ๐Ÿ‘
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'}