From 64200e00e143d4382bfbf6e8e8c9cf152ccb95a3 Mon Sep 17 00:00:00 2001 From: chronoblade Date: Fri, 12 Sep 2025 15:12:42 +0500 Subject: [PATCH] add lesson --- 12-09/12-09.py | 3 +++ 12-09/task1_rpo254.py | 23 +++++++++++++++++++++++ 12-09/task2_rpo254.py | 13 +++++++++++++ 12-09/task3_rpo254.py | 4 ++++ 4 files changed, 43 insertions(+) create mode 100644 12-09/12-09.py create mode 100644 12-09/task1_rpo254.py create mode 100644 12-09/task2_rpo254.py create mode 100644 12-09/task3_rpo254.py diff --git a/12-09/12-09.py b/12-09/12-09.py new file mode 100644 index 0000000..4747cce --- /dev/null +++ b/12-09/12-09.py @@ -0,0 +1,3 @@ +for i in range(0, 20): + print("*", end=' ') +print(i) \ No newline at end of file diff --git a/12-09/task1_rpo254.py b/12-09/task1_rpo254.py new file mode 100644 index 0000000..d520299 --- /dev/null +++ b/12-09/task1_rpo254.py @@ -0,0 +1,23 @@ +import sys + +number_input = int(input("Введите число :: ")) + +if number_input < 100 and number_input > 1: + if number_input % 3 and number_input % 5: + print("Fizz Buzz") + sys.exit(1) + elif number_input % 3 != 0 and number_input % 5 != 0: + print(number_input) + sys.exit(1) + elif number_input % 3 == 0: + print("Fizz") + sys.exit(1) + elif number_input % 5: + print("Buzz") + sys.exit(1) + +else: + print("ОШИБКА! Введено число не в диапазоне") + sys.exit(1) + + diff --git a/12-09/task2_rpo254.py b/12-09/task2_rpo254.py new file mode 100644 index 0000000..d1a4dc6 --- /dev/null +++ b/12-09/task2_rpo254.py @@ -0,0 +1,13 @@ +import sys + +number = int(input("Введите число :: ")) +stage = float(input("Введите степень(0-7) :: ")) + +if stage <= 7 and stage >= 1: + numbd = number ** stage + print("Ответ: {}".format(numbd)) + sys.exit(1) + +else: + print("ОШИБКА, введена степень выше/ниже диапазона") + sys.exit(1) \ No newline at end of file diff --git a/12-09/task3_rpo254.py b/12-09/task3_rpo254.py new file mode 100644 index 0000000..04c8483 --- /dev/null +++ b/12-09/task3_rpo254.py @@ -0,0 +1,4 @@ +available_operators = [ "mts", "tmobile", "t2", "yota" ] +print("Подерживаемые операторы:\n" + join(available_operators)) +operator = int(input("Введите Оператора: ")) \ No newline at end of file