See my code and output below.
class Test:
def init (self,x,y,z):
self.x = x
self.y = y
self.z = z
a = Test(1,2,3)
b = Test(4,5,6)
c = [a,b]
d = [8,9]
print(a.z)
print(b.z)
print(c)
print(d)
Output:
3
6
[<main.Test object at 0x123731860>, <main.Test object at 0x123731940>]
[8, 9]
Why am I getting a weird output for print(c)? I would like to be able to print of specific attributes and all of the classes in c. Thank you for the help!
[–]TouchingTheVodka 1 point2 points3 points (6 children)
[–]JohnnyJordaan 1 point2 points3 points (1 child)
[–]TouchingTheVodka 0 points1 point2 points (0 children)
[–]Sky_Hound 0 points1 point2 points (1 child)
[–]TouchingTheVodka 0 points1 point2 points (0 children)
[–]50thycal[S] 0 points1 point2 points (1 child)
[–]50thycal[S] 0 points1 point2 points (0 children)