-
Notifications
You must be signed in to change notification settings - Fork 73
Practical work 3 Pogorely_E_P #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Practical work 3
Practical work 3
Practical work 3
Practical work 3
Practical work 3
Practical work 3
Practical work 3
Lesson_01.py
Outdated
var_input_first = int(input('Введите первое число: ')) | ||
var_input_second = int(input('Введите второе число: ')) | ||
|
||
print(div(var_input_first, var_input_second)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- валидацию нужно делать через try except
- y >0:
res = x/y
проверьте все листинги на пеп-8
Lesson_02.py
Outdated
email = input('Введите email:') | ||
tel = input('Введите телефон: ') | ||
|
||
print(person(name, sec_name, age, city, email, tel)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не выполнено
ункция должна принимать параметры как именованные аргументы.
Lesson_03.py
Outdated
elif c > b > a: | ||
return c + b | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sum: int
что это?
Lesson_04.py
Outdated
y = int(input('Введите целое отрицательное число: ')) | ||
|
||
print(f'Ответ с использывание встроеной функции {my_func(x, y)}') | ||
print(f'Ответ с использованием цикла {my_func_cicle(x, y)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Lesson_05.py
Outdated
ex = True | ||
else: | ||
res += sum_input(user_input) | ||
print(res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Lesson_06.py
Outdated
|
||
input_string = input('Введите слово латинскими буквами в нижнем регистре: ') | ||
|
||
print(int_func(input_string)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Lesson_07.py
Outdated
|
||
|
||
input_string = input('Введите слово латинскими буквами в нижнем регистре: ') | ||
print(int_func(input_string)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Lesson_01.py
Outdated
print(hours) | ||
print(pay_hour) | ||
print(bonus) | ||
# Не понял как правельно передать параметры в скрипт |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
правельно - правИльно....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нужно смотреть вебинары
в них препод-ль все показывает
Lesson_02.py
Outdated
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}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new_list.pop(0)
для чкего это?
Lesson_03.py
Outdated
# Подсказка: используйте функцию range() и генератор. | ||
|
||
ls = [el for el in range(20, 241) if el % 20 == 0 or el % 21 == 0] | ||
print(ls) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Lesson_04.py
Outdated
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}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Lesson_05.py
Outdated
|
||
|
||
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])}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Lesson_06.py
Outdated
break | ||
print(el) | ||
|
||
from itertools import cycle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
все импорты строго в начале модуля
Lesson_07.py
Outdated
print(i) | ||
x += 1 | ||
else: | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Less_4.py
Outdated
print(gaz.show_speed()) | ||
print(zaz.show_speed()) | ||
print(uaz.police()) | ||
print(uaz.show_speed()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Less_5.py
Outdated
handle = Handle('Маркер') | ||
print(pen.draw()) | ||
print(pencil.draw()) | ||
print(handle.draw()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Less_1.py
Outdated
[6, 7, 93], | ||
[24, 5, 97]]) | ||
|
||
print(my_matrix.__add__()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my_matrix = Matrix([[5, 18, 11],
[6, 17, 23],
[41, 50, 9]],
[[45, 8, 2],
[6, 7, 93],
[24, 5, 97]])
print(my_matrix.add())
с перегрузками не разобрались
нужно складывать два объекта класса
Matrix и add вручную не вызывают
Less_2.py
Outdated
print(coat.get_sq_full) | ||
print(jacket.get_sq_full) | ||
print(jacket.get_square_c()) | ||
print(jacket.get_square_j()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Less_3.py
Outdated
print(cells2 - cells1) | ||
print(cells2.make_order(5)) | ||
print(cells1.make_order(10)) | ||
print(cells1 / cells2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а здесь же все правильно
почему тогда в первом так?
print(today.valid(11, 13, 2011)) | ||
print(Data.extract('11 - 11 - 2011')) | ||
print(today.extract('11 - 11 - 2020')) | ||
print(Data.valid(1, 11, 2000)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
div = DivisionByNull(10, 100) | ||
print(DivisionByNull.divide_by_null(10, 0)) | ||
print(DivisionByNull.divide_by_null(10, 0.1)) | ||
print(div.divide_by_null(100, 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не выполнено, в этом задании нужно
-) создать класс-исключение
-) сгенерировать это исключение
-) отловить его через try-except
return f'Вы вышли' | ||
|
||
try_except = Error(1) | ||
print(try_except.my_input()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не выполнено, в этом задании нужно
-) создать класс-исключение
-) сгенерировать это исключение
-) отловить его через try-except
|
||
|
||
sklad = Sklad() | ||
print(sklad.__dict__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sklad
транслит
return f'{self.name} {self.series} {self.make} {self.year}' | ||
|
||
def action(self): | ||
return 'Печатает' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
print(unit_2.reception()) | ||
print(unit_3.reception()) | ||
print(unit_1.to_print()) | ||
print(unit_3.to_copier()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
z_2 = ComplexNumber(3, 4) | ||
print(z_1) | ||
print(z_1 + z_2) | ||
print(z_1 * z_2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено
Practical work 3