Skip to content

Instantly share code, notes, and snippets.

View KatUser's full-sized avatar
🌊
Dreams of sea that will never see

Qatya KatUser

🌊
Dreams of sea that will never see
  • CFT
  • Novosibirsk, Russia
  • 00:17 (UTC +07:00)
View GitHub Profile
@KatUser
KatUser / Sys исчисления
Created July 23, 2020 08:01
88 = 32 +22 +17 +16 in 9 sys
trees = int(input())
apples, pears, plums, cherries = int(input()), int(input()), int(input()), int(input())
sys = 1
def findsys(s):
while True:
if (trees//10) * (s**1) + (trees%10) * (s**0) == (apples//10) * (s**1) + (apples%10) * (s**0) + (pears // 10) * (s ** 1) + (pears % 10) * (s ** 0) + (plums//10) * (s**1) + (plums%10) * (s**0) + (cherries//10) * (s**1) + (cherries%10) * (s**0):
print(s)
@KatUser
KatUser / scratch.py
Created July 22, 2020 08:09
Ceaser_decoder
en_alphabet = [x for x in range(ord('a'), ord('z') + 1)]
s = input()
whitespace = 'whitespace'
s = s.replace(' ', ' whitespace')
s = s.split(whitespace)
for word in s:
counter = 0
for symbol in word:
if ord(symbol.lower()) in en_alphabet:
@KatUser
KatUser / Ceaser_2 sdvig_vpravo na 17
Created July 18, 2020 02:51
Ceaser_2 in EN sdvig_vpravo na 17
en_alphabet = [x for x in range(ord('a'), ord('z') + 1)]
#97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
# a b c d e f g h i j k l m n o p q r s t u v w x y z
# a - 97 b - 98 c - 99 d - 100 e - 101 f - 102 g - 103 h - 104
# i - 105 j - 106 k - 107 l - 108 m - 109 n - 110 o - 111 p - 112
# q - 113 r - 114 s - 115 t - 116 u - 117 v - 118 w - 119 x - 120
# y - 121 z - 122
# l = 108 / t = 116
@KatUser
KatUser / Trash_1
Created July 18, 2020 02:00
Ceasar_code_ru
rus_alphabet = [x for x in range(ord('а'), ord('я') + 1)]
n = int(input())
s = 'Блажен, кто верует, тепло ему на свете!'
for i in s:
if ord(i.lower()) in rus_alphabet:
print((chr(ord(i)+n)),end ='')
else:
print(i, end='')
@KatUser
KatUser / Pswd_gen.py
Created July 18, 2020 00:42
pswd generator
import random
digits = '23456789'
lowercase_letters = 'abcdefghjkmnpqrstuvwxyz'
uppercase_letters = 'ABCDEFGHJKMNPQRSTUVWXYZ'
punctuation = '!#$%&*+-=?@^_.'
chars = ''
exceptions = 'Iil1Lo0O'
t = ''
@KatUser
KatUser / Try.py
Last active April 13, 2021 12:02
Right Pyradime
n = int(input())
s = 0
for num in range(n):
for i in range(1, s + 1):
print(i, end='')
for j in range(s + 1, 0, -1):
print(j, end='')
print()
@KatUser
KatUser / Try.py
Created July 16, 2020 09:08
Pyramide Pyramide
n = int(input())
c = ''
for i in range(1,n+1):
a = c+str(i),c[::-1]
print(''.join(a))
c= c+str(i)
@KatUser
KatUser / Try.py
Created July 15, 2020 03:01
Ceazer code
n = int(input())
s = input()
# [97 , 123]
for i in s:
if int(ord(i)-n) in range(97 , 123):
print(chr(int(ord(i)-n)), end = '')
else:
print(chr(int(ord(i) -n)+26), end = '')
@KatUser
KatUser / Scratch2.py
Created July 14, 2020 08:39
Guessing Game
import random
z = random.randint(1,100)
print('Добро пожаловать в числовую угадайку!\nПожалуйста,введите число ниже:')
counter = 0
while True:
n = input()
def check():
if int(n) < z:
print(f'Ваше число меньше загаданного, попробуйте еще разок')
elif int(n) > z:
@KatUser
KatUser / scratch3.py
Created July 14, 2020 08:37
Brackets
def is_correct_bracket(text):
a = ''
while True:
a = text
text = text.replace('()', '')
if len(text.replace('()', '')) == len(a):
break
if len(text) == 0:
return True
else: