When using repr to test the class that I have created, I always get brackets around my printed value.
ex)
def __repr__(self):
return ("H")
runs in shell as [H, H, H, H] for 4 lines. I want to remove the brackets and the commas but am unsure how to do this using repr. Do i need to create another method that repr returns instead?
Thank you for you help.
you must hide some thing. i think you have a list to contain all your instances, that's why you see a pair of
[
,]
.i don't have any such issue.
i think this seems to be your situation: