diff --git a/03_lesson/__pycache__/address.cpython-313.pyc b/03_lesson/__pycache__/address.cpython-313.pyc new file mode 100644 index 0000000..79ddd5f Binary files /dev/null and b/03_lesson/__pycache__/address.cpython-313.pyc differ diff --git a/03_lesson/__pycache__/mailing.cpython-313.pyc b/03_lesson/__pycache__/mailing.cpython-313.pyc new file mode 100644 index 0000000..94cc0e3 Binary files /dev/null and b/03_lesson/__pycache__/mailing.cpython-313.pyc differ diff --git a/03_lesson/__pycache__/smartphone.cpython-313.pyc b/03_lesson/__pycache__/smartphone.cpython-313.pyc new file mode 100644 index 0000000..d59d71a Binary files /dev/null and b/03_lesson/__pycache__/smartphone.cpython-313.pyc differ diff --git a/03_lesson/__pycache__/user.cpython-313.pyc b/03_lesson/__pycache__/user.cpython-313.pyc new file mode 100644 index 0000000..62518aa Binary files /dev/null and b/03_lesson/__pycache__/user.cpython-313.pyc differ diff --git a/03_lesson/address.py b/03_lesson/address.py new file mode 100644 index 0000000..0bf38a1 --- /dev/null +++ b/03_lesson/address.py @@ -0,0 +1,7 @@ +class Address: + def __init__(self, index, city, street, house, flat): + self.index = index + self.city = city + self.street = street + self.house = house + self.flat = flat diff --git a/03_lesson/lesson_3_task_1.py b/03_lesson/lesson_3_task_1.py new file mode 100644 index 0000000..acfa1f2 --- /dev/null +++ b/03_lesson/lesson_3_task_1.py @@ -0,0 +1,7 @@ +from user import User + +my_user = User("Наталья", "Сазонова") + +print(my_user.get_first_name()) +print(my_user.get_last_name()) +print(my_user.get_User_info()) diff --git a/03_lesson/lesson_3_task_2.py b/03_lesson/lesson_3_task_2.py new file mode 100644 index 0000000..78183e0 --- /dev/null +++ b/03_lesson/lesson_3_task_2.py @@ -0,0 +1,16 @@ +from smartphone import Smartphone + + +# Создаем список книг (библиотеку) +catalog = [ + Smartphone("Samsung", "S24", "+7908888888"), + Smartphone("Samsung", "S25", "+7907777777"), + Smartphone("Samsung", "Z", "+7906666666"), + Smartphone("POCO", "F7", "+7905555555"), + Smartphone("POCO", "X7", "+7904444444") +] + +# Печатаем библиотеку +for smartphone in catalog: + print(f"{smartphone.phone_brand} - {smartphone.phone_model} - " + f"{smartphone.subscriber_number}") diff --git a/03_lesson/lesson_3_task_3.py b/03_lesson/lesson_3_task_3.py new file mode 100644 index 0000000..bdc49c0 --- /dev/null +++ b/03_lesson/lesson_3_task_3.py @@ -0,0 +1,17 @@ +from address import Address +from mailing import Mailing + + +to_address = Address("117042", "Москва", "Венёвская", "5", "2") +from_address = Address("105037", "Москва", "Измайловская", "20", "40") + + +mailing = Mailing(to_address, from_address, 123, "SG141115188") + + +print(f"Отправление {mailing.track} из {mailing.to_address.index}, " + f"{mailing.to_address.city}, {mailing.to_address.street}, " + f"{mailing.to_address.house} - {mailing.to_address.flat} в " + f"{mailing.from_address.index}, {mailing.from_address.city}, " + f"{mailing.from_address.street}, {mailing.from_address.house} - " + f"{mailing.from_address.flat}. Стоимость {mailing.cost} рублей.") diff --git a/03_lesson/mailing.py b/03_lesson/mailing.py new file mode 100644 index 0000000..a0351b6 --- /dev/null +++ b/03_lesson/mailing.py @@ -0,0 +1,6 @@ +class Mailing: + def __init__(self, to_address, from_address, cost, track): + self.to_address = to_address + self.from_address = from_address + self.cost = cost + self.track = track diff --git a/03_lesson/smartphone.py b/03_lesson/smartphone.py new file mode 100644 index 0000000..1a8e933 --- /dev/null +++ b/03_lesson/smartphone.py @@ -0,0 +1,5 @@ +class Smartphone: + def __init__(self, phone_brand, phone_model, subscriber_number): + self.phone_brand = phone_brand + self.phone_model = phone_model + self.subscriber_number = subscriber_number diff --git a/03_lesson/user.py b/03_lesson/user.py new file mode 100644 index 0000000..ba3acdc --- /dev/null +++ b/03_lesson/user.py @@ -0,0 +1,13 @@ +class User: + def __init__(self, first_name: str, last_name: str): + self.first_name = first_name + self.last_name = last_name + + def get_first_name(self): + print(self.first_name) + + def get_last_name(self): + print(self.last_name) + + def get_User_info(self): + print(f"{self.first_name} + {self.last_name}")