This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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='') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
digits = '23456789' | |
lowercase_letters = 'abcdefghjkmnpqrstuvwxyz' | |
uppercase_letters = 'ABCDEFGHJKMNPQRSTUVWXYZ' | |
punctuation = '!#$%&*+-=?@^_.' | |
chars = '' | |
exceptions = 'Iil1Lo0O' | |
t = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input()) | |
c = '' | |
for i in range(1,n+1): | |
a = c+str(i),c[::-1] | |
print(''.join(a)) | |
c= c+str(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = '') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
NewerOlder