FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programmingWithPythonCode/classes/point_user_wrong.py at main · thomasWeise/programmingWithPythonCode · GitHub
thomasWeise
programmingWithPythonCode
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
programmingWithPythonCode
/
classes
/
point_user_wrong.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
9 lines (6 loc) · 387 Bytes
Breadcrumbs
programmingWithPythonCode
/
classes
/
point_user_wrong.py
Copy path
File metadata and controls
9 lines (6 loc) · 387 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
"""Example of using our class where we change the `Final` attributes."""
from
point
import
Point
# Import our class from its module.
p1
:
Point
=
Point
(
3
,
5
)
# Create a first instance of Point.
print
(
f"
{
p1
.
x
=
}
,
{
p1
.
y
=
}
"
)
# p1.x = 3, p1.y = 5
p1
.
x
=
5
# This is not allowed, but possible!
print
(
f"
{
p1
.
x
=
}
,
{
p1
.
y
=
}
"
)
# p1.x = 5, p1.y = 5
Back
|
FazBrowse Home
|
New Git URL