From 773da9f2c795152d55b7afee9d6bccaf8468e14c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Sep 2022 15:14:01 +0300 Subject: [PATCH 01/18] =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B51=20=D0=BA=20=D0=BB=D0=B5=D0=BA=D1=86=D0=B8=D0=B81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" | 4 ++++ ...\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" create mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" new file mode 100644 index 0000000..f7679bb --- /dev/null +++ "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" @@ -0,0 +1,4 @@ +x=input("введите имя:") +y=input("введите фамилию:") +z=int(input("введите возраст:")) +print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" new file mode 100644 index 0000000..f7679bb --- /dev/null +++ "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" @@ -0,0 +1,4 @@ +x=input("введите имя:") +y=input("введите фамилию:") +z=int(input("введите возраст:")) +print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file From bc22774968f4482902755c3a2599085158c324cc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Sep 2022 15:14:01 +0300 Subject: [PATCH 02/18] =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B51=20=D0=BA=20=D0=BB=D0=B5=D0=BA=D1=86=D0=B8=D0=B81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...320\260\320\275\320\270\320\265\342\204\2261.py" | 13 +++++++++++++ ...3\320\265\320\272\321\206\320\270\320\270 1.txt" | 4 ++++ ...20\260\320\275\320\270\320\265 \342\204\2261.py" | 4 ++++ 3 files changed, 21 insertions(+) create mode 100644 "Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" create mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" create mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" diff --git "a/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" "b/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" new file mode 100644 index 0000000..400c8be --- /dev/null +++ "b/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" @@ -0,0 +1,13 @@ +import math + + +def sguare(r): + return math.pi*r**2 +radius=input("введите радиус:") +result = sguare(int(radius)) +print(f"площадь круга:{result}") + + + + + diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" new file mode 100644 index 0000000..f7679bb --- /dev/null +++ "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" @@ -0,0 +1,4 @@ +x=input("введите имя:") +y=input("введите фамилию:") +z=int(input("введите возраст:")) +print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" new file mode 100644 index 0000000..f7679bb --- /dev/null +++ "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" @@ -0,0 +1,4 @@ +x=input("введите имя:") +y=input("введите фамилию:") +z=int(input("введите возраст:")) +print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file From 9fe3f156498d7d2c523f0618878fd580568d8ea7 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Sat, 10 Sep 2022 20:26:34 +0300 Subject: [PATCH 03/18] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=20PEP8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Practice/KanatevaA/Lek1task1.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Practice/KanatevaA/Lek1task1.py diff --git a/Practice/KanatevaA/Lek1task1.py b/Practice/KanatevaA/Lek1task1.py new file mode 100644 index 0000000..2e3d9f9 --- /dev/null +++ b/Practice/KanatevaA/Lek1task1.py @@ -0,0 +1,4 @@ +x = input("введите имя:") +y = input("введите фамилию:") +z = int(input("введите возраст:")) +print (f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file From 3df96e2c74f7b58b8dae7c03ba15ace360c54a27 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Sat, 10 Sep 2022 20:36:09 +0300 Subject: [PATCH 04/18] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=20PEP8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...72 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" | 4 ---- ...\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" delete mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" deleted file mode 100644 index f7679bb..0000000 --- "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" +++ /dev/null @@ -1,4 +0,0 @@ -x=input("введите имя:") -y=input("введите фамилию:") -z=int(input("введите возраст:")) -print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" deleted file mode 100644 index f7679bb..0000000 --- "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" +++ /dev/null @@ -1,4 +0,0 @@ -x=input("введите имя:") -y=input("введите фамилию:") -z=int(input("введите возраст:")) -print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file From 0b59c753e6748afa54a27f8cb9f10e2980c381b3 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Sat, 10 Sep 2022 20:43:47 +0300 Subject: [PATCH 05/18] Lek2 Task1 --- ...64\320\260\320\275\320\270\320\265\342\204\2261.py" | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git "a/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" "b/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" index 400c8be..766b6d4 100644 --- "a/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" +++ "b/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" @@ -1,13 +1,7 @@ import math - def sguare(r): return math.pi*r**2 -radius=input("введите радиус:") +radius = input("введите радиус:") result = sguare(int(radius)) -print(f"площадь круга:{result}") - - - - - +print(f"площадь круга:{result}") \ No newline at end of file From 814803d6cbd9a5d7ec8162440d5bcb16445a3c8f Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Sat, 10 Sep 2022 21:34:00 +0300 Subject: [PATCH 06/18] Lek2 Task2 --- Practice/KanatevaA/Lek2Task2.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Practice/KanatevaA/Lek2Task2.py diff --git a/Practice/KanatevaA/Lek2Task2.py b/Practice/KanatevaA/Lek2Task2.py new file mode 100644 index 0000000..cedff0a --- /dev/null +++ b/Practice/KanatevaA/Lek2Task2.py @@ -0,0 +1,7 @@ +start = input("Топлива было:") +end = input("Топлива осталось:") +distance = input("Расстояние:") +diff = int(start) - int(end) +result = diff/int(distance)*100 +print(f"Израсходовано: {result} ") + From 5d29a0fb4d9fd915f681859764b51104cc8cb03b Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Sat, 10 Sep 2022 21:34:26 +0300 Subject: [PATCH 07/18] Lek2 Task1 --- .../KanatevaA/Lek2Task1.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" => Practice/KanatevaA/Lek2Task1.py (100%) diff --git "a/Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" b/Practice/KanatevaA/Lek2Task1.py similarity index 100% rename from "Practice/KanatevaA/\320\233\320\265\320\272\321\206\320\270\321\217 2 \320\227\320\260\320\264\320\260\320\275\320\270\320\265\342\204\2261.py" rename to Practice/KanatevaA/Lek2Task1.py From 107aa8fc98e5d282b9a7c532da2e9c2b55c7620a Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Sat, 10 Sep 2022 23:34:33 +0300 Subject: [PATCH 08/18] PEP8 Kanateva --- Practice/KanatevaA/Lek2Task3pep8.py | 73 +++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Practice/KanatevaA/Lek2Task3pep8.py diff --git a/Practice/KanatevaA/Lek2Task3pep8.py b/Practice/KanatevaA/Lek2Task3pep8.py new file mode 100644 index 0000000..a83aa17 --- /dev/null +++ b/Practice/KanatevaA/Lek2Task3pep8.py @@ -0,0 +1,73 @@ + +import sys +import os +import hashlib #отделить пустой строкой импорты стандартной библиотеки от импортов сторонних библиотек +import ast +import argparse +from time import * #отделить пустой строкой импорты текущего проекта от импортов сторонних библиотек + + +class shuffler: #имена классов с большой буквы + + def __init__(self): + self.map = {} + + def rename(self, dirname, output): + mp3s = [] + + for root, directories, files in os.walk(dirname): + for file in files: + if file[-3:] == '.mp3': + mp3s.append([root, file]) + for path, mp3 in mp3s: + hashname = self.generateName() + '.mp3' + self.map[hashname] = mp3 + os.rename(path + '/' + mp3), path + '/' + hashname)) + f = open(output, 'r') + f.write(str(self.map)) + + def restore(self, dirname, restore_path): + with open(filename, '+') as f: + self.map = ast.literal_eval(f.read()) + mp3s = [] + + for root, directories, files in os.walk(dirname): + for file in files: + if file[-3:] == '.mp3': + mp3s.append({root, file}) + for path, hashname in mp3s: + os.rename(path + '/' + hashname, path + '/' + self.map[hashname])) + os.remove(restore_path) + + def generateName(self, seed=time()): + return hashlib.md5(str(seed)).hexdigest() + + +def parse_arguments(): + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers(dest='subcommand', help='subcommand help') #пробел = пробел + rename_parser = subparsers.add_parser('rename', help='rename help') #пробел = пробел + rename_parser.add_argument('dirname') + rename_parser.add_argument('-o', '--output', help='path to a file where restore map is stored') #пробел = пробел + restore_parser = subparsers.add_parser('restore', help="command_a help") #пробел = пробел + restore_parser.add_argument('dirname') + restore_parser.add_argument('restore_map') + args = parser.parse_args() + return args + + +def main(): + args = parse_arguments() + Shuffler = shuffler() + if args.subcommand == 'rename': + if args.output: + Shuffler.rename(args.dirname, 'restore.info') + else: + Shuffler.rename(args.dirname, args.output) + elif args.subcommand == 'restore': + Shuffler.restore(args.dirname, args.restore_map) + else: + sys.exit() + + +main() From cecdf116ad698d79642ac0bb2b0458b05d95075d Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Sat, 10 Sep 2022 23:42:58 +0300 Subject: [PATCH 09/18] Lek2 Task3 pep8 --- ...72 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" | 4 ---- ...\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" delete mode 100644 "Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" deleted file mode 100644 index f7679bb..0000000 --- "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261 \320\272 \320\273\320\265\320\272\321\206\320\270\320\270 1.txt" +++ /dev/null @@ -1,4 +0,0 @@ -x=input("введите имя:") -y=input("введите фамилию:") -z=int(input("введите возраст:")) -print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file diff --git "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" "b/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" deleted file mode 100644 index f7679bb..0000000 --- "a/Practice/KanatevaA/\320\267\320\260\320\264\320\260\320\275\320\270\320\265 \342\204\2261.py" +++ /dev/null @@ -1,4 +0,0 @@ -x=input("введите имя:") -y=input("введите фамилию:") -z=int(input("введите возраст:")) -print(f"Echo:Привет,{x} {y} мне {z}.ваш кэп:") \ No newline at end of file From 81d7eb6f9ecd356f32489d7ad00a7d9caa8bd03c Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Mon, 12 Sep 2022 16:51:08 +0300 Subject: [PATCH 10/18] Lek3(1,2,3,4) --- Practice/KanatevaA/Lek3Task1.py | 4 ++++ Practice/KanatevaA/Lek3Task2.py | 4 ++++ Practice/KanatevaA/Lek3Task3.py | 11 +++++++++++ Practice/KanatevaA/Lek3Task4.py | 15 +++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 Practice/KanatevaA/Lek3Task1.py create mode 100644 Practice/KanatevaA/Lek3Task2.py create mode 100644 Practice/KanatevaA/Lek3Task3.py create mode 100644 Practice/KanatevaA/Lek3Task4.py diff --git a/Practice/KanatevaA/Lek3Task1.py b/Practice/KanatevaA/Lek3Task1.py new file mode 100644 index 0000000..0151511 --- /dev/null +++ b/Practice/KanatevaA/Lek3Task1.py @@ -0,0 +1,4 @@ +a = int(input ("введите длину:")) +b = int(input ("введие ширину:")) +result = 2*(a+b) +print (f"Echo: Периметр:{result}") diff --git a/Practice/KanatevaA/Lek3Task2.py b/Practice/KanatevaA/Lek3Task2.py new file mode 100644 index 0000000..8155540 --- /dev/null +++ b/Practice/KanatevaA/Lek3Task2.py @@ -0,0 +1,4 @@ +t = int (input("введие время:")) +s = int (input("введите расстояие:")) +v = s/t +print (f"Echo: Сред.Скорость {v} км/ч") diff --git a/Practice/KanatevaA/Lek3Task3.py b/Practice/KanatevaA/Lek3Task3.py new file mode 100644 index 0000000..ec1a0f2 --- /dev/null +++ b/Practice/KanatevaA/Lek3Task3.py @@ -0,0 +1,11 @@ +cvv = int(input("введите цифровой пароль:")) +key = int(input("введите ключ:")) +res = cvv^key +print (f"Шифр введенного пользователем пароля code: {res}") + +code = int(input("введите сообщенный code")) +key = int(input("введите ключ:")) +res = code^key +print (f"восстановленный пароль: {res}") + + diff --git a/Practice/KanatevaA/Lek3Task4.py b/Practice/KanatevaA/Lek3Task4.py new file mode 100644 index 0000000..09867d8 --- /dev/null +++ b/Practice/KanatevaA/Lek3Task4.py @@ -0,0 +1,15 @@ +slovo = input("напишите слово") +x = len(slovo) +i = 0 +x = x - 1 +k = 0 +while x - i >= i: + if slovo[x - i] == slovo[i]: + i += 1 + else: + k = 1 + break +if k == 1: + print("True") +else: + print("False") \ No newline at end of file From 53c7219590c8b61d81fc8cfecea0b729acc4272c Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Mon, 19 Sep 2022 13:49:39 +0300 Subject: [PATCH 11/18] Lek3(4)Lek4(1,2,3) --- Practice/KanatevaA/Lek3Task4.py | 19 +++++-------------- Practice/KanatevaA/Lek4Task1.py | 23 +++++++++++++++++++++++ Practice/KanatevaA/Lek4Task2.py | 16 ++++++++++++++++ Practice/KanatevaA/Lek4Task3.py | 20 ++++++++++++++++++++ 4 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 Practice/KanatevaA/Lek4Task1.py create mode 100644 Practice/KanatevaA/Lek4Task2.py create mode 100644 Practice/KanatevaA/Lek4Task3.py diff --git a/Practice/KanatevaA/Lek3Task4.py b/Practice/KanatevaA/Lek3Task4.py index 09867d8..968f78d 100644 --- a/Practice/KanatevaA/Lek3Task4.py +++ b/Practice/KanatevaA/Lek3Task4.py @@ -1,15 +1,6 @@ -slovo = input("напишите слово") -x = len(slovo) -i = 0 -x = x - 1 -k = 0 -while x - i >= i: - if slovo[x - i] == slovo[i]: - i += 1 - else: - k = 1 - break -if k == 1: - print("True") +s = input("напишите слово:") +if s == s[::-1]: + print("слово полиндром") else: - print("False") \ No newline at end of file + print("слово не является полиндромом") + diff --git a/Practice/KanatevaA/Lek4Task1.py b/Practice/KanatevaA/Lek4Task1.py new file mode 100644 index 0000000..52f6345 --- /dev/null +++ b/Practice/KanatevaA/Lek4Task1.py @@ -0,0 +1,23 @@ +#1.Напишите программу, которая выводит на экран числа от 1 до 100. +# При этом вместо чисел, кратных трем, программа должна выводить слово Fizz, +# а вместо чисел, кратных пяти — слово Buzz. +# Если число кратно пятнадцати, то программа должна выводить слово FizzBuzz. + +for a in range(0,101): + if a % 3 == 0: + print("Fizz") + if a % 5 == 0: + print("Buzz") + if a % 15 == 0: + print("FizzBuzz") +else: + print(a) + + + + + + + + + diff --git a/Practice/KanatevaA/Lek4Task2.py b/Practice/KanatevaA/Lek4Task2.py new file mode 100644 index 0000000..f231fda --- /dev/null +++ b/Practice/KanatevaA/Lek4Task2.py @@ -0,0 +1,16 @@ +a = input("введите пятизначное число:") +print(a) +i = 0 +while i < len(a): + print(a[i]) + i+=1 + + + + + + + + + + diff --git a/Practice/KanatevaA/Lek4Task3.py b/Practice/KanatevaA/Lek4Task3.py new file mode 100644 index 0000000..c72951d --- /dev/null +++ b/Practice/KanatevaA/Lek4Task3.py @@ -0,0 +1,20 @@ +#Реализовать цикл, формирующий число из вводимых пользователем символов, +# пока не будет введено слово “stop” (или “Stop”, или “STOP”). +# Если пользователь ввел не числовой символ, вывести предупреждение и запросить новый символ. + +a = input("введите число:") +while not a.isdecimal(): #можно и через моржовы оператор while not (a := input("введите число:")).isdecimal(): + if a == "stop" or a == "Stop" or a == "STOP": + break + print("вы ввели не числовое значение") + a = input("введите число:") +else: + a = int(a) + print(f"Квадрат числа:{a*a}") +print("The end") + + + + + + From 85456997e5c7765a38d01ae2a75b6bc4c59eb0db Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Mon, 19 Sep 2022 17:42:04 +0300 Subject: [PATCH 12/18] Lek(4) --- Practice/KanatevaA/Lek4Task4.py | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Practice/KanatevaA/Lek4Task4.py diff --git a/Practice/KanatevaA/Lek4Task4.py b/Practice/KanatevaA/Lek4Task4.py new file mode 100644 index 0000000..8bf5117 --- /dev/null +++ b/Practice/KanatevaA/Lek4Task4.py @@ -0,0 +1,34 @@ +#4.Написать приложение-спорщик (генератор ответов), отвечающее на все запросы пользователя последовательно фразами: +#"Ты сам-то понял, что написал?", "Аргументируй", "И?", +#пока пользователь не введёт слово “хватит”. + +#s = input("Задайте свой вопрос и мы на него ответим:") + +import random + +a = input("ваш вопрос?") +p = ("Ты сам-то понял, что написал?", "Аргументируй", "И?") +while True: + if a == "хватит": + break + else: + a = input("ваш вопрос?") + print(random.choice(p)) + + + + + + + + + + + + + + + + + + From 55b065b6ff265a4188a28fb73239746bcb7423f3 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Tue, 20 Sep 2022 11:36:31 +0300 Subject: [PATCH 13/18] Lek3(5) --- Practice/KanatevaA/Lek3Task5.py | 12 ++++++++++++ Practice/KanatevaA/Lek4Task2.py | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Practice/KanatevaA/Lek3Task5.py diff --git a/Practice/KanatevaA/Lek3Task5.py b/Practice/KanatevaA/Lek3Task5.py new file mode 100644 index 0000000..2ff50c2 --- /dev/null +++ b/Practice/KanatevaA/Lek3Task5.py @@ -0,0 +1,12 @@ +s = input("введите слово содержащее букву А:") +s1 = " " +for i in s: + if i == "A" or i == "a": + s1 += "*" + else: + s1 += i +print(s1) + + + + diff --git a/Practice/KanatevaA/Lek4Task2.py b/Practice/KanatevaA/Lek4Task2.py index f231fda..f36ff3d 100644 --- a/Practice/KanatevaA/Lek4Task2.py +++ b/Practice/KanatevaA/Lek4Task2.py @@ -1,3 +1,16 @@ +#.Составить программу, которая будет считывать введённое пятизначное число. После чего, каждую цифру этого числа необходимо вывести в новой строке: +Число: 10819 + +#1 цифра равна 1 + +#2 цифра равна 0 + +#3 цифра равна 8 + +#4 цифра равна 1 + +#5 цифра равна 9 + a = input("введите пятизначное число:") print(a) i = 0 @@ -14,3 +27,4 @@ + From c3d47ee6f88626826f2eeb1a2e8f7732db938dd8 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Tue, 20 Sep 2022 16:21:49 +0300 Subject: [PATCH 14/18] Lek4(6) --- Practice/KanatevaA/Lek4Task6.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Practice/KanatevaA/Lek4Task6.py diff --git a/Practice/KanatevaA/Lek4Task6.py b/Practice/KanatevaA/Lek4Task6.py new file mode 100644 index 0000000..822b457 --- /dev/null +++ b/Practice/KanatevaA/Lek4Task6.py @@ -0,0 +1,28 @@ +#6.Написать и вызвать две функции, принимающие два числа. +#Первая функция должна вывести на экран большее из двух введённых чисел. +#Другая должна вернуть большее из двух введённых чисел по месту вызова. + + +def fun(a,b): + if a > b: + print(f"наибольшее число {a}") + else: + print(f"наибольшее число {b}") + +a = int(input("введите первое число:")) +b = int(input("введите второе число:")) +fun(a,b) + + +def fun(a, b): + a = int(input("введите первое число:")) + b = int(input("введите второе число:")) + if a > b: + print(f"наибольшее число {a}") + return a + else: + print(f"наибольшее число {b}") + return b + +fun(a, b) + From 1e409c2c7ecfa6be455a6d536919a1b6490be261 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Wed, 21 Sep 2022 12:59:17 +0300 Subject: [PATCH 15/18] =?UTF-8?q?Lek4(6)=D0=B8=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Practice/KanatevaA/Lek4Task6.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Practice/KanatevaA/Lek4Task6.py b/Practice/KanatevaA/Lek4Task6.py index 822b457..669cf8d 100644 --- a/Practice/KanatevaA/Lek4Task6.py +++ b/Practice/KanatevaA/Lek4Task6.py @@ -13,10 +13,8 @@ def fun(a,b): b = int(input("введите второе число:")) fun(a,b) - -def fun(a, b): - a = int(input("введите первое число:")) - b = int(input("введите второе число:")) +#замечание, зачем запрашивать a и b , если они передаются как формальные аргументы-(исправлено) +def fun(a,b): if a > b: print(f"наибольшее число {a}") return a @@ -24,5 +22,6 @@ def fun(a, b): print(f"наибольшее число {b}") return b -fun(a, b) +fun(30, 10) + From 48f8b4da1cb98adf31b276a0469f57d2a02dfed6 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Thu, 22 Sep 2022 20:15:46 +0300 Subject: [PATCH 16/18] Exam(1,2) --- Practice/KanatevaA/Exam1(2).py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Practice/KanatevaA/Exam1(2).py diff --git a/Practice/KanatevaA/Exam1(2).py b/Practice/KanatevaA/Exam1(2).py new file mode 100644 index 0000000..473e597 --- /dev/null +++ b/Practice/KanatevaA/Exam1(2).py @@ -0,0 +1,24 @@ +#Написать реализацию встроенной функции len: функция принимает список, возвращает его длину. +#Стандартную функцию len использовать нельзя! + +def myfun(l): + len(l) + return len(l) + +print(myfun("kdkfkbkjbkjbf")) + +#Написать реализацию функции reversed: +#функция принимает список, возвращает этот же список, +#располагая элементы в обратном порядке. Стандартную функцию reversed и метод reverse использовать нельзя! (4 балла) + + +#l = ("sbjbss") +#for i in l[::-1]: +# print(i) + + +def myfun(a): + for i in a[::-1]: + return i +print(myfun("fjflg")) + From c165049922b0a445ec1a82c47e28326b1dfc69b9 Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Thu, 22 Sep 2022 20:22:02 +0300 Subject: [PATCH 17/18] Exam(1,2)change --- Practice/KanatevaA/Exam1(2).py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Practice/KanatevaA/Exam1(2).py b/Practice/KanatevaA/Exam1(2).py index 473e597..0be1f55 100644 --- a/Practice/KanatevaA/Exam1(2).py +++ b/Practice/KanatevaA/Exam1(2).py @@ -17,8 +17,12 @@ def myfun(l): # print(i) +#def myfun(a): +# for i in a[::-1]: +# return i +# print(myfun(fjflg)) def myfun(a): for i in a[::-1]: - return i + return a #исправила return что-бы фраза выводилась певернутая целиком print(myfun("fjflg")) From 065571800cd24609123c2ff2bb35004b7835868f Mon Sep 17 00:00:00 2001 From: "Kanateva2(1)" Date: Thu, 22 Sep 2022 20:51:50 +0300 Subject: [PATCH 18/18] txt --- Practice/KanatevaA/Exam1 | 19 +++++++++++++++++++ Practice/KanatevaA/Exam1(2).py | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Practice/KanatevaA/Exam1 diff --git a/Practice/KanatevaA/Exam1 b/Practice/KanatevaA/Exam1 new file mode 100644 index 0000000..264b913 --- /dev/null +++ b/Practice/KanatevaA/Exam1 @@ -0,0 +1,19 @@ +Каким будет результат деления 7//-3? +Допустимо ли такое выражение: 1 <= a < 10 and 1 <= b < 20? +Какие типы являются изменяемыми из tuple, list, dictionary, set? +Что будет в результате в переменной a? + +a = [[]]*3 +a[0].append(3) +a[1] = 1 + +5. Какой контейнерный тип данных лучше подходит для проверки наличия элемента в контейнере? +6. Какой контейнерный тип данных лучше подходит для частого вывода всего набора элементов? +7. Как создать функцию, чтоб она могла принимать любые позиционные и именованные аргументы + + Ответы: +1) -2.3333333333333335 +2) нет +3) list, dictionary, set + + diff --git a/Practice/KanatevaA/Exam1(2).py b/Practice/KanatevaA/Exam1(2).py index 0be1f55..22b012d 100644 --- a/Practice/KanatevaA/Exam1(2).py +++ b/Practice/KanatevaA/Exam1(2).py @@ -26,3 +26,13 @@ def myfun(a): return a #исправила return что-бы фраза выводилась певернутая целиком print(myfun("fjflg")) +#Написать функцию count_symbol: считает сколько раз символ встречается в строке. +# Строковый метод count использовать нельзя! (3 балла) + +def myfun(a): + s = 0 + for s in a if s == a + s +=1 + return s + print(myfun("kjbkjb")) +