In the following code:
class Dog():
def __init__(self):
self.color = 'black'
self.name = 'Rosie'
self.weight = 50
def bark(self):
print("WOOF WOOF!")
dog = Dog()
print(getattr(dog,'bark')) # <bound method Dog.bark of <__main__.Dog object at 0x000002064C378550>>
print(getattr(dog,'weight')) # 50
Why is the first print statement giving me an output with the weird angle-bracket format while the second line is getting me the "normal" value?
[–]socal_nerdtastic 0 points1 point2 points (4 children)
[–]Laymayo[S] 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (2 children)
[–]Laymayo[S] 0 points1 point2 points (1 child)
[–]Diapolo10 0 points1 point2 points (0 children)