+ 1
Where i am mistaken ?
class SpecailString: def __init__(self,cont): self.cont = cont def __truediv__(self,other): line ="=" * len (other.cont) return "\n".join([self.cont,line, other.cont]) A = SpecailString("spam") B = SpecailString("egg") print(A / B)
2 Antworten
+ 1
return "\n".join([self.cont,line, other.cont])
You put line break after `return` statement. The `return` and `join` method call must be on the same line 👍
0
Thnx, it helps me lot. after many efforts , I can't understand.you show me right path.