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
eb='๐Ÿ…ฐ๐Ÿ…ฑยฉ๐ŸŒ›๐Ÿ“ง๐ŸŽ๐ŸŒ€๐Ÿจโ„นโคด๐Ÿ’ƒ๐Ÿ›ดโ“‚โ™‘๐Ÿ…พ๐Ÿ…ฟ๐Ÿ’ซยฎ๐Ÿ’ฒโœโ›Žโ™ˆ๐Ÿ”ฑโœ–๐Ÿฆžโšก\t'
m='hello'
print(''.join([eb[-1 if c==' ' else ord(c)-65] for c in m.upper()]))
โ—๏ธโซ#โƒฃ๐Ÿฆ๐Ÿฅจ๐Ÿ”—๐Ÿ”ผโ†ช๏ธโ†ฉ๏ธ*โƒฃโž•๐ŸฆŽโž–โ–ช๏ธ๐Ÿ—ก0โƒฃ1โƒฃ2โƒฃ3โƒฃ4โƒฃ5โƒฃ6โƒฃ7โƒฃ8โƒฃ9โƒฃ๐Ÿšฆ๐Ÿšฆโ—€๏ธ๐Ÿ”€โ–ถ๏ธโ”๐Ÿ“Ž๐Ÿ…ฐ๐Ÿ…ฑยฉ๐ŸŒ›๐Ÿ“ง๐ŸŽ๐ŸŒ€๐Ÿจโ„นโคด๐Ÿ’ƒ๐Ÿ›ดโ“‚โ™‘๐Ÿ…พ๐Ÿ…ฟ๐Ÿ’ซยฎ๐Ÿ’ฒโœโ›Žโ™ˆ๐Ÿ”ฑโœ–๐Ÿฆžโšก
Language:
py3


Source:
eb={65:'๐Ÿ…ฐ',66:'๐Ÿ…ฑ',67:'ยฉ', 68:'๐ŸŒ›',69:'๐Ÿ“ง',70:'๐ŸŽ',71:'๐ŸŒ€',72:'๐Ÿจ',73:'โ„น',74:'โคด',75:'๐Ÿ’ƒ',76:'๐Ÿ›ด',77:'โ“‚',78:'โ™‘',79:'๐Ÿ…พ',80:'๐Ÿ…ฟ',81:'๐Ÿ’ซ',82:'ยฎ',83:'๐Ÿ’ฒ',84:'โœ',85:'โ›Ž',86:'โ™ˆ',87:'๐Ÿ”ฑ',88:'โœ–',89:'๐Ÿฆž',90:'โšก',32:'\t'}
m='hello world'
print(''.join(eb[ord(c)] for c in m.upper()))


Result:
๐Ÿจ๐Ÿ“ง๐Ÿ›ด๐Ÿ›ด๐Ÿ…พ ๐Ÿ”ฑ๐Ÿ…พยฎ๐Ÿ›ด๐ŸŒ›
emojibet='๐Ÿ…ฐ๐Ÿ…ฑยฉ๐ŸŒ›๐Ÿ“ง๐ŸŽ๐ŸŒ€๐Ÿจโ„นโคด๐Ÿ’ƒ๐Ÿ›ดโ“‚โ™‘๐Ÿ…พ๐Ÿ…ฟ๐Ÿ’ซยฎ๐Ÿ’ฒโœโ›Žโ™ˆ๐Ÿ”ฑโœ–๐Ÿฆžโšก\t'
alpha=''.join(map(chr, range(65,91)))+' '
text='hello there'.upper()
table=text.maketrans(alpha,emojibet)
print(text.translate(table))
alpha='๐Ÿ…ฐ๐Ÿ…ฑยฉ๐ŸŒ›๐Ÿ“ง๐ŸŽ๐ŸŒ€๐Ÿจโ„นโคด๐Ÿ’ƒ๐Ÿ›ดโ“‚โ™‘๐Ÿ…พ๐Ÿ…ฟ๐Ÿ’ซยฎ๐Ÿ’ฒโœโ›Žโ™ˆ๐Ÿ”ฑโœ–๐Ÿฆžโšก\t'
m='I bring unto you people an abomination'
print(''.join([alpha[-1 if c==' ' else ord(c)-65] for c in m.upper()]))
s/([aeiou])([^aeiou ])|([^aeiou ])([aeiou])/\2\1\4\3/g
ns=[]
n=0
while (len(ns)<5):
if n>6:
n+=2
if n%5==0:
n+=2
else:
n+=1
i=0
repeat=1
while (i==len(ns) or repeat==0):
i+=1
if n%ns[i]==0:
repeat=0
if repeat==1:
ns.append(n)
print(ns)
import re
isprime = lambda p: p > 1 and (p < 4 or (p % 2 and all(p % i for i in range(3, int(p**0.5) + 1))))
print(re.sub(r'\s+','',str(''.join(list(map(chr,filter(isprime, range(1, 5000, 2))))))))
isprime = lambda p: p > 1 and (p < 4 or (p % 2 and all(p % i for i in range(3, int(p**0.5) + 1))))
print(list(filter(isprime, range(1, 5153, 2))))
lambda p: p > 1 and (p < 4 or (p % 2 and all(p % i for i in range(3, int(p**0.5) + 1, 2))))
arr=[]
for i in range(126989, 129687):
arr.append(chr(i))
print(''.join(arr))
Language:
py3


Source:
print(str(15976853504/1024/1024/1024)[:5]+' gibibytes')


Result:
14.87 gibibytes
Language:
py3


Source:
class Face():
def __init__(self, pimples):
self.pimples = pimples
@property
def remove_pimples(self):
del self.pimples
return 'pimples removed.'

face = Face("pimples")
print(face.remove_pimples)


Result:
pimples removed.
Language:
py3


Source:
class Nice:
"""Nice.
Attribute:
nice (str, optional): Input. Default: "nice".
"""
def __init__(self, nice: str = "nice") -> None:
self.nice = nice

@property
def get(self) -> str:
"""str: Input or default."""
return self.nice

print(Nice().get)


Result:
nice
Language:
py3


Source:
a,x,y,z,j,k,b,m=1,5.5,0,2,3,5,4,0
while y<((a*a)/z+(a*z))*(x*z)*j+k:y+=a;
while m<(b*((a+a)*j*j-a)):m+=b;
print(''.join(map(chr,[y]+[m]*k*z)))


Result:
XDDDDDDDDDD
s/[aeiou]|(ll)|(?<![aeiou])y(?![aeiou])/uw/gi
Language:
py3


Source:
class LonamiPity:
def __init__(s,b):s.b=b;
def withdraw(s,a):return'no w/d!';
def deposit(s,a):a=abs(a);s.b+=a;return 'deposited: '+str(a);
def balance(s):return'bal: '+str(s.b);
p=LonamiPity(20)

print('\n'.join([
p.withdraw(10),
p.deposit(25),
p.balance()]))


Result:
no w/d!
deposited: 25
bal: 45
Language:
py3


Source:
pizza = ['๐Ÿ•']*8
eat=pizza.remove

while pizza:
for slice in pizza:
pizza_left=len(pizza)
print('{} {} left:\n{}\n'.format(pizza_left, 'slices' if pizza_left>1 else 'slice', ''.join(pizza)))

eat(slice)


Result:
8 slices left:
๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•

7 slices left:
๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•

6 slices left:
๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•

5 slices left:
๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•

4 slices left:
๐Ÿ•๐Ÿ•๐Ÿ•๐Ÿ•

3 slices left:
๐Ÿ•๐Ÿ•๐Ÿ•

2 slices left:
๐Ÿ•๐Ÿ•

1 slice left:
๐Ÿ•
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)))