From 0f598e0b16391922d670d9031a2400283d416a80 Mon Sep 17 00:00:00 2001 From: Tusa05 Date: Sun, 21 Sep 2025 20:17:27 +0300 Subject: [PATCH] lesson3 --- 03_lesson/__pycache__/address.cpython-313.pyc | Bin 0 -> 656 bytes 03_lesson/__pycache__/mailing.cpython-313.pyc | Bin 0 -> 634 bytes .../__pycache__/smartphone.cpython-313.pyc | Bin 0 -> 611 bytes 03_lesson/__pycache__/user.cpython-313.pyc | Bin 0 -> 1110 bytes 03_lesson/address.py | 7 +++++++ 03_lesson/lesson_3_task_1.py | 7 +++++++ 03_lesson/lesson_3_task_2.py | 16 ++++++++++++++++ 03_lesson/lesson_3_task_3.py | 17 +++++++++++++++++ 03_lesson/mailing.py | 6 ++++++ 03_lesson/smartphone.py | 5 +++++ 03_lesson/user.py | 13 +++++++++++++ 11 files changed, 71 insertions(+) create mode 100644 03_lesson/__pycache__/address.cpython-313.pyc create mode 100644 03_lesson/__pycache__/mailing.cpython-313.pyc create mode 100644 03_lesson/__pycache__/smartphone.cpython-313.pyc create mode 100644 03_lesson/__pycache__/user.cpython-313.pyc create mode 100644 03_lesson/address.py create mode 100644 03_lesson/lesson_3_task_1.py create mode 100644 03_lesson/lesson_3_task_2.py create mode 100644 03_lesson/lesson_3_task_3.py create mode 100644 03_lesson/mailing.py create mode 100644 03_lesson/smartphone.py create mode 100644 03_lesson/user.py diff --git a/03_lesson/__pycache__/address.cpython-313.pyc b/03_lesson/__pycache__/address.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79ddd5f6aaf8e5d6bf6252cb75ce3d0dcb751c4f GIT binary patch literal 656 zcmX|8J!{-R5S`V>`R?MwE^_94Nnz5dF-L-%V1fg#kAMhKAy^b??<`nL$?l5ex>T+% z<^72Kn>2=FTUYKvL`a(%ePlpyX7%=I-i+$WWDFP|7C&$9F+b3u53eig85TR3!3zjs z4k5d6T1LUz3EZ^5PnmUxdXB{oVo)pu<%CSRp)&{Ng|70~Uf|nUzCzeRbSyEq5uM4t14Iki`2dKnBq^GR-pSrMtRY}aZ06@hCcauP&CSLRv{6DB z>)(`>7S>zI!~_HDX(3mNjHm;GA;E}%R-}nIYr?)vU&rsYP`bhRy8KeeGRbtTO_gop z#Vamxu(F7gcEs~f8$0AYFLJ}VJ?;iS@88fA`WeDE*iYx%@&4&-JKCQ--#+P&-$yml z5csV#^3ytN+>+5H4uCC+k z5UD3lS0PwBp_}ge#j8GP0uHti1E~nei4?h!699RUOa9Ue{rd1#Qs|;w{t`;+_dIbj z-Q}-&%&>*|iDuu~{9Nxh!2DA8IsoP`v@lv*La1h;R}XE4NtRJ=Og&mqwYtu{v@*8# zEhXtYR^pjlFX({DbSN+oIASoO>RhaTm_ChPo19FG@yqICsjDP2v9arH6JI_;&3mdc zUUjFsc)zI!h(%dg#QLN^>&5<$2sgJFKEW=ycQxMKx&M7|dv`j$I@(QwFT;jQ5PF@I zR#YobM9snjnOr8ToF@+vS5>yw5|0o+tP|Z=#)yl8jO9Dd%LMoiGyHWt|E%kg@+{={l(tiWYid1s)`@ve6E3v;F$ce0 PrPM#iS7(2Kp(XqWoPCU( literal 0 HcmV?d00001 diff --git a/03_lesson/__pycache__/smartphone.cpython-313.pyc b/03_lesson/__pycache__/smartphone.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d59d71aca53b7379d474cee5379c0d75de70ffb3 GIT binary patch literal 611 zcmYLGPixdr5TBQ1+qi9QMGMOcQay;dl*Of&BAz_&B?x;64B71KHt_bPzV|}u&6D3? zzk~fY9xTWMPoBJqLA*MXP3%B^GxKKVH-FL`91MZv^W@9rchW!D=_TrnW<uWo#dSnARt`p5TMp7xJCvVB7E5xzZr`86JO`26)<{H&pOFgpaZWQU1#zLrEZ zM5HZh#r8hphdNhXBIrQo;;?@Qa1amg3yNb$w0da)}3Hj5Ngn2<&F`J zZ`Oqjd84xJM`J-{U>42Dl76r$Yzz})2$FI-j`MRB_iD+b;!>k`ulcwUG%Fj@JAQWj zLLI6D)%5~j%4TEPQ%9<+KH~RTeNu-vy%xqTJ$w?`oYx!mkn<=_sg{OEqAw>9p2A74 z@G^UHdEr&2k7uZkxZ{Cr{mL8~ZCHc*xc|Ef*fjJNnSMrx2^yZHP)A%qj50MpbhS>8z!iITHpFFIw^NXZc?ymdZxx{6cX zY@VV%@)2t}kAQ=nntfxv%f8L3+3O$d?#xmCAg^xRRoN9~ujtq4BIV*3$%LedG8yN5 zySdQ{$e!T*QL7RR{$zPP!=T>q8%@pyl@e0~GX%2;(Iw7hSPAP@UI{}{f6xkj$$1Cj za-;@99n(M~kreeDdWMm>*0Wh+zL#W){4a!67RS)_GHOeQ1{hVXp2` literal 0 HcmV?d00001 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}")