From 6564bb2e18e2eccb77204497b4171042ec320bd4 Mon Sep 17 00:00:00 2001 From: VladAndAlex Date: Fri, 10 Mar 2023 22:21:02 +0300 Subject: [PATCH 1/5] Created solution for the 1-st task --- lesson_1/solution_1.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 lesson_1/solution_1.py diff --git a/lesson_1/solution_1.py b/lesson_1/solution_1.py new file mode 100644 index 0000000..73a4234 --- /dev/null +++ b/lesson_1/solution_1.py @@ -0,0 +1,2 @@ +numbers = list(map(float, input().split())) +print(sum(numbers)) \ No newline at end of file From 48e01126033833fb417cf3b52e58c02391f52930 Mon Sep 17 00:00:00 2001 From: VladAndAlex Date: Sat, 11 Mar 2023 00:25:16 +0300 Subject: [PATCH 2/5] Created solution for the 2-nd task --- lesson_1/solution_2.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lesson_1/solution_2.py diff --git a/lesson_1/solution_2.py b/lesson_1/solution_2.py new file mode 100644 index 0000000..b463fca --- /dev/null +++ b/lesson_1/solution_2.py @@ -0,0 +1,5 @@ +st = input() +while True: + rule = input() + st = st.replace(rule[0], rule[3]) + print(st) \ No newline at end of file From 25911b012fd91f0462136eeac89db958492df7a4 Mon Sep 17 00:00:00 2001 From: VladAndAlex Date: Sat, 11 Mar 2023 00:48:19 +0300 Subject: [PATCH 3/5] Created solution for the 3-rd task --- lesson_1/solution_3.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lesson_1/solution_3.py diff --git a/lesson_1/solution_3.py b/lesson_1/solution_3.py new file mode 100644 index 0000000..7b7b0bc --- /dev/null +++ b/lesson_1/solution_3.py @@ -0,0 +1,3 @@ +numbers = list(map(float, input().split())) +for i in numbers: + print(str(int(abs(i))) + ' ', end = '') \ No newline at end of file From b7de82c57ab93568e4168d85f7e44c07f5eb2ebf Mon Sep 17 00:00:00 2001 From: VladAndAlex Date: Sat, 11 Mar 2023 00:55:52 +0300 Subject: [PATCH 4/5] Created solution for the 4-th task --- lesson_1/solution_4.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lesson_1/solution_4.py diff --git a/lesson_1/solution_4.py b/lesson_1/solution_4.py new file mode 100644 index 0000000..a38d524 --- /dev/null +++ b/lesson_1/solution_4.py @@ -0,0 +1,5 @@ +numbers = list(map(float, input().split())) +summ = 0 +for i in numbers: + summ += i*i +print(summ) \ No newline at end of file From 3b90761afb63327dd8cfdfa80d1eb14c9a5a02b8 Mon Sep 17 00:00:00 2001 From: VladAndAlex Date: Sat, 11 Mar 2023 15:26:43 +0300 Subject: [PATCH 5/5] Created solution for the 5-th task --- lesson_1/solution_5.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lesson_1/solution_5.py diff --git a/lesson_1/solution_5.py b/lesson_1/solution_5.py new file mode 100644 index 0000000..f4fe531 --- /dev/null +++ b/lesson_1/solution_5.py @@ -0,0 +1,13 @@ +s = list(input()) +d = int(input()) % 26 #delta + +for i in range(len(s)): + tmp = d + if s[i] == ' ': + continue + elif ord(s[i]) + tmp > ord('z') or ('A' <= s[i] <= 'Z') and (ord(s[i]) + tmp > ord('Z')): + tmp -= 26 + s[i] = chr(ord(s[i]) + tmp) + +s = ''.join(s) +print(s) \ No newline at end of file