mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-27 17:06:44 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
5443c8ec21
commit
272d6248a4
@ -10,7 +10,8 @@ class Person:
|
|||||||
# Without __str__(): <__main__.Person object at 0x000001AC025E7230>
|
# Without __str__(): <__main__.Person object at 0x000001AC025E7230>
|
||||||
# With __str__():
|
# With __str__():
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'Name: {self.name}. Age: {self.age}'
|
return f"Name: {self.name}. Age: {self.age}"
|
||||||
|
|
||||||
|
|
||||||
# Creating an object using class
|
# Creating an object using class
|
||||||
p = Person("John", 21)
|
p = Person("John", 21)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user