FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
60-python-projects/python_decorator.py at main · Dihfahsih1/60-python-projects · GitHub
Dihfahsih1
/
60-python-projects
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
60-python-projects
/
python_decorator.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
23 lines (19 loc) · 597 Bytes
Breadcrumbs
60-python-projects
/
python_decorator.py
Copy path
File metadata and controls
executable file
·
23 lines (19 loc) · 597 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class
Person
(
object
):
def
__init__
(
self
,
first_name
,
last_name
):
self
.
first_name
=
first_name
self
.
last_name
=
last_name
@
property
def
full_name
(
self
):
# return "%s %s" % (self.first_name,self.last_name)
print
(
"%s %s"
%
(
self
.
first_name
,
self
.
last_name
))
@
full_name
.
setter
def
full_name
(
self
,
value
):
parts
=
value
.
split
()
if
len
(
parts
)
==
2
:
self
.
first_name
=
parts
[
0
]
self
.
last_name
=
parts
[
1
]
else
:
self
.
first_name
=
value
self
.
last_name
=
""
p
=
Person
(
input
(
'Enter Your name:
\n
'
),
input
(
"Enter last name:
\n
"
))
p
.
full_name
Back
|
FazBrowse Home
|
New Git URL