Skip to content

Conversation

evgeniypogoreliy
Copy link

Practical work 3

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))

Choose a reason for hiding this comment

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

  1. валидацию нужно делать через try except
  2. y >0:
    res = x/y
    проверьте все листинги на пеп-8

Lesson_02.py Outdated
email = input('Введите email:')
tel = input('Введите телефон: ')

print(person(name, sec_name, age, city, email, tel))

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


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)}')

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)

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))

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))

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)
# Не понял как правельно передать параметры в скрипт

Choose a reason for hiding this comment

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

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

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}')

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)

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}')

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])}')

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

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

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())

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())

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__())

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())

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)

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))

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))

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())

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__)

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 'Печатает'

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())

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)

Choose a reason for hiding this comment

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

выполнено

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants