Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
16d6e67
Create Lesson_01.py
evgeniypogoreliy Jan 25, 2023
3a32f48
Create Lesson_02.py
evgeniypogoreliy Jan 25, 2023
babb021
Create Lesson_03.py
evgeniypogoreliy Jan 25, 2023
13f9556
Create Lesson_04.py
evgeniypogoreliy Jan 25, 2023
cd586db
Create Lesson_05.py
evgeniypogoreliy Jan 25, 2023
cac1425
Create Lesson_06.py
evgeniypogoreliy Jan 25, 2023
4124c0e
Create Lesson_07.py
evgeniypogoreliy Jan 25, 2023
98980b1
Practical work 4
evgeniypogoreliy Jan 30, 2023
b173d00
Practical work 4
evgeniypogoreliy Jan 30, 2023
55b912b
Practical work 4
evgeniypogoreliy Jan 30, 2023
203d39f
Practical work 4
evgeniypogoreliy Jan 30, 2023
6ffa361
Practical work 4
evgeniypogoreliy Jan 30, 2023
8c7f74d
Practical work 4
evgeniypogoreliy Jan 30, 2023
fa4a73c
Practical work 4
evgeniypogoreliy Jan 30, 2023
1a74dae
Delete Lesson_01.py
evgeniypogoreliy Feb 2, 2023
56a112e
Delete Lesson_02.py
evgeniypogoreliy Feb 2, 2023
6a15565
Delete Lesson_03.py
evgeniypogoreliy Feb 2, 2023
37852ee
Delete Lesson_04.py
evgeniypogoreliy Feb 2, 2023
d984c17
Delete Lesson_05.py
evgeniypogoreliy Feb 2, 2023
f3ee376
Delete Lesson_06.py
evgeniypogoreliy Feb 2, 2023
307bea5
Delete Lesson_07.py
evgeniypogoreliy Feb 2, 2023
7563fec
Practical work 5
evgeniypogoreliy Feb 2, 2023
77f1868
Practical work 5
evgeniypogoreliy Feb 2, 2023
fa49010
Practical work 5
evgeniypogoreliy Feb 2, 2023
f03e726
Practical work 5
evgeniypogoreliy Feb 2, 2023
91c4d1c
Practical work 5
evgeniypogoreliy Feb 2, 2023
b0f4953
Practical work 5
evgeniypogoreliy Feb 2, 2023
03dbe20
Practical work 5
evgeniypogoreliy Feb 2, 2023
2459f00
Delete Less_7.py
evgeniypogoreliy Feb 7, 2023
6ec341a
Delete Less_6.py
evgeniypogoreliy Feb 7, 2023
13490ad
Delete Less_5.py
evgeniypogoreliy Feb 7, 2023
cd6e9b0
Delete Less_4.py
evgeniypogoreliy Feb 7, 2023
52539fd
Delete Less_3.py
evgeniypogoreliy Feb 7, 2023
af888a8
Delete Less_2.py
evgeniypogoreliy Feb 7, 2023
e4812f6
Delete Less_1.py
evgeniypogoreliy Feb 7, 2023
9a605ab
Practical work 6
evgeniypogoreliy Feb 7, 2023
661408b
Practical work 6
evgeniypogoreliy Feb 7, 2023
44cdd5e
Practical work 6
evgeniypogoreliy Feb 7, 2023
3a69e72
Practical work 6
evgeniypogoreliy Feb 7, 2023
b0efbf8
Practical work 6
evgeniypogoreliy Feb 7, 2023
bff2bd0
Delete Less_5.py
evgeniypogoreliy Feb 10, 2023
0c8864b
Delete Less_4.py
evgeniypogoreliy Feb 10, 2023
10e0d38
Delete Less_3.py
evgeniypogoreliy Feb 10, 2023
92e5ee1
Delete Less_2.py
evgeniypogoreliy Feb 10, 2023
815dbcd
Delete Less_1.py
evgeniypogoreliy Feb 10, 2023
6ea7028
Practical work 7
evgeniypogoreliy Feb 10, 2023
92f8ea5
Practical work 7
evgeniypogoreliy Feb 10, 2023
88c059b
Practical work 7
evgeniypogoreliy Feb 10, 2023
17e9197
Delete Less_1.py
evgeniypogoreliy Feb 12, 2023
a903767
Delete Less_2.py
evgeniypogoreliy Feb 12, 2023
8c09661
Delete Less_3.py
evgeniypogoreliy Feb 12, 2023
146cfe4
Practical work 8
evgeniypogoreliy Feb 12, 2023
6c65765
Practical work 8
evgeniypogoreliy Feb 12, 2023
f729457
Practical work 8
evgeniypogoreliy Feb 12, 2023
1ddac2a
Practical work 8
evgeniypogoreliy Feb 12, 2023
31e3768
Practical work 8
evgeniypogoreliy Feb 12, 2023
4bd25a9
Practical work 8
evgeniypogoreliy Feb 12, 2023
ec9cefd
Praticical work 8
evgeniypogoreliy Feb 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Lesson_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 1. Реализовать скрипт, в котором должна быть предусмотрена функция расчёта заработной
# платы сотрудника. Используйте в нём формулу: (выработка в часах*ставка в час) + премия.
# Во время выполнения расчёта для конкретных значений необходимо запускать скрипт с параметрами.

from sys import argv

hours, pay_hour, bonus = argv

# res = int(hours) * int(pay_hour) + int(bonus)
#
# print(res)

print(hours)
print(pay_hour)
print(bonus)
# Не понял как правельно передать параметры в скрипт
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

правельно - правИльно....

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно смотреть вебинары
в них препод-ль все показывает

12 changes: 12 additions & 0 deletions Lesson_02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 2. Представлен список чисел. Необходимо вывести элементы исходного списка, значения
# которых больше предыдущего элемента.
# Подсказка: элементы, удовлетворяющие условию, оформить в виде списка.
# Для его формирования используйте генератор.
# Пример исходного списка: [300, 2, 12, 44, 1, 1, 4, 10, 7, 1, 78, 123, 55].
# Результат: [12, 44, 4, 10, 78, 123].

my_list = [300, 2, 12, 44, 1, 1, 4, 10, 7, 1, 78, 123, 55]
new_list = [el for i, el in enumerate(my_list) if my_list[i] > my_list[i - 1]]
res = new_list.pop(0)
print(f'Исходный список {my_list}')
print(f'Список с результатом {new_list}')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new_list.pop(0)
для чкего это?

6 changes: 6 additions & 0 deletions Lesson_03.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 3. Для чисел в пределах от 20 до 240 найти числа, кратные 20 или 21.
# Решите задание в одну строку.
# Подсказка: используйте функцию range() и генератор.

ls = [el for el in range(20, 241) if el % 20 == 0 or el % 21 == 0]
print(ls)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

10 changes: 10 additions & 0 deletions Lesson_04.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 4. Представлен список чисел. Определите элементы списка, не имеющие повторений.
# Сформируйте итоговый массив чисел, соответствующих требованию. Элементы выведите
# в порядке их следования в исходном списке. Для выполнения задания обязательно используйте генератор(LC).
# Пример исходного списка: [2, 2, 2, 7, 23, 1, 44, 44, 3, 2, 10, 7, 4, 11].
# Результат: [23, 1, 3, 10, 4, 11]

my_list = [2, 2, 2, 7, 23, 1, 44, 44, 3, 2, 10, 7, 4, 11]
new_list = [el for i, el in enumerate(my_list) if my_list.count(el) < 2]
print(f'Исходный список {my_list}')
print(f'Список с результатом {new_list}')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

13 changes: 13 additions & 0 deletions Lesson_05.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 5. Реализовать формирование списка, используя функцию range() и возможности генератора.
# В список должны войти чётные числа от 100 до 1000 (включая границы). Нужно получить
# результат вычисления произведения всех элементов списка.
# Подсказка: использовать функцию reduce().

from functools import reduce

def my_func(el_p, el):
return el_p * el


print(f'Список четных значений {[el for el in range(100, 1001) if el % 2 == 0]}')
print(f'Произведение всех элементов списка {reduce(my_func, [el for el in range(100, 1001) if el % 2 == 0])}')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено

22 changes: 22 additions & 0 deletions Lesson_06.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Подсказка: используйте функцию count() и cycle() модуля itertools.
# Обратите внимание, что создаваемый цикл не должен быть бесконечным.
# Предусмотрите условие его завершения. #### Например, в первом задании выводим целые числа, начиная с 3.
# # При достижении числа 10 — завершаем цикл. Вторым пунктом необходимо предусмотреть условие,
# # при котором повторение элементов списка прекратится.

from itertools import count

for el in count(3):
if el == 10:
break
print(el)

from itertools import cycle
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все импорты строго в начале модуля


c = 0
for el in cycle('ABC'):
if c > 10:
break
print(el)
c += 1

25 changes: 25 additions & 0 deletions Lesson_07.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 7. Реализовать генератор с помощью функции с ключевым словом yield, создающим очередное значение.
# При вызове функции должен создаваться объект-генератор. Функция вызывается следующим образом:
# for el in fact(n). Она отвечает за получение факториала числа.
# В цикле нужно выводить только первые n чисел, начиная с 1! и до n!.
# Подсказка: факториал числа n — произведение чисел от 1 до n.
# Например, факториал четырёх 4! = 1 * 2 * 3 * 4 = 24.

from itertools import count
from math import factorial

def fact():
for el in count(1):
yield factorial(el)


space = fact()
n = int(input('Введите число n: '))
x = 0
for i in space:
if x < n:
print(i)
x += 1
else:
break
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выполнено