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
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
def caesar_code(text, shift): | |
# Обьявление переменных для проверки введенного символа на возможность шифровки. | |
# Также переменная, содержащая длину алфавита, включая наличие 0-го индекса, счетчик ошибок и обьявление new_text. | |
letters_lowercase = 'abcdefghijklmnopqrstuvwxyz' | |
letters_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
symbols = ' -=_+.,~!:@#$%^&*()[]{}\'\"<>:;' | |
numbers = '0123456789' | |
length = len(letters_lowercase) | |
error_count = 0 |
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
from math import * | |
n = int(input('Введите число: ')) | |
factor = 2 | |
if n < 2: | |
print('Ошибка. Число меньше двух') | |
else: | |
print(f'Простые множители числа {n}:') | |
while factor <= n: |
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
from math import * | |
n = int(input('Введите число: ')) # Присвоение переменной n вводимого в консоль значения | |
factor = 2 # Инициализация factor с присвоением 2-ух | |
factors = [] | |
# Проверка на правильность вводимого числа | |
if n < 2: | |
print('Ошибка. Число меньше двух') | |
else: |
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
# Находим сколько дней в году, проверяя на високосность | |
if year % 4 == 0 and year % 100 != 0 or year % 400 == 0: | |
feb = 29 | |
else: | |
feb = 28 |
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 ordinalDate(day, month, year): | |
day = int(day) | |
month = int(month) | |
year = int(year) | |
# Находим сколько дней в году, проверяя на високосность | |
if year % 4 == 0 and year % 100 != 0 or year % 400 == 0: | |
feb = 29 | |
else: |
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 sravnenie(a, b): | |
if a > b: | |
print(f'{a} больше {b}') | |
elif b > a: | |
print(f'{b} больше {a}') | |
else: | |
print(f'{a} равно {b}') | |
def mediana(a, b, c): |
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
day = int(input('Введите день: ')) | |
month = int(input('Введите месяц: ')) | |
year = int(input('Введите год: ')) | |
# Количество дней, уже прошедших, до определенного месяца: | |
days_before_month = (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334) | |
# Проверка на високосность, для месяцев до марта добавление +1 дня не актуально: | |
if month > 2 and year % 4 == 0 or year % 100 == 0 and year % 400 == 0: | |
print(days_before_month[month - 1] + day + 1) |
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
massiv_kvadratov = [ | |
[0, 100, 400, 900, 1600, 2500, 3600, 4900, 6400, 8100], | |
[1, 121, 441, 961, 1681, 2601, 3721, 5041, 6561, 8281], | |
[4, 144, 484, 1024, 1764, 2704, 3844, 5184, 6724, 8464], | |
[16, 196, 576, 1156, 1936, 2916, 4096, 5476, 7056, 8836], | |
[25, 225, 625, 1225, 2025, 3025, 4225, 5626, 7225, 9025], | |
[36, 256, 676, 1296, 2116, 3136, 4356, 5776, 7396, 9216], | |
[49, 289, 729, 1369, 2209, 3249, 4489, 5929, 7569, 9409], | |
[64, 324, 784, 1444, 2304, 3364, 4624, 6084, 7744, 9604], | |
[81, 361, 841, 1521, 2401, 3481, 4761, 6241, 7921, 9801] |
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
massiv1 = [ | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], | |
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], |
OlderNewer