Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added 03_lesson/__pycache__/address.cpython-313.pyc
Binary file not shown.
Binary file added 03_lesson/__pycache__/mailing.cpython-313.pyc
Binary file not shown.
Binary file added 03_lesson/__pycache__/smartphone.cpython-313.pyc
Binary file not shown.
Binary file added 03_lesson/__pycache__/user.cpython-313.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions 03_lesson/address.py
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions 03_lesson/lesson_3_task_1.py
Original file line number Diff line number Diff line change
@@ -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())
16 changes: 16 additions & 0 deletions 03_lesson/lesson_3_task_2.py
Original file line number Diff line number Diff line change
@@ -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}")
17 changes: 17 additions & 0 deletions 03_lesson/lesson_3_task_3.py
Original file line number Diff line number Diff line change
@@ -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} рублей.")
6 changes: 6 additions & 0 deletions 03_lesson/mailing.py
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions 03_lesson/smartphone.py
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions 03_lesson/user.py
Original file line number Diff line number Diff line change
@@ -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}")