+ 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)

7th Feb 2020, 8:57 AM
sushil mundhra
sushil mundhra - avatar
2 ответов
+ 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 👍
7th Feb 2020, 9:26 AM
Ipang
0
Thnx, it helps me lot. after many efforts , I can't understand.you show me right path.
8th Feb 2020, 9:20 AM
sushil mundhra
sushil mundhra - avatar