Discussioni Q&A
can someone help..
what does this code means so it could have the output like on the example..
class SpecialString:
def __init__(self, cont):
self.cont = cont
def __gt__(self, other):
for index in range(len(other.cont)+1):
result = other.cont[:index] + ">" + self.cont
result += ">" + other.cont[index:]
print(result)
spam = SpecialString("spam")
eggs = SpecialString("eggs")
spam > eggs
1 Voto
6 RisposteNeed help
1 Voto
1 RispostaNeed help
0 Voti
1 RispostaWhats wrong with this
3 Voti
7 Rispostemagic methods
0 Voti
2 RisposteWhat is an r method?
3 Voti
3 RisposteWhy do we override?
2 Voti
3 RispostePopolare oggi
Pointers cpp
3 Votes
Is pro worth the money ?
1 Votes
Coding for Cybersecurity
0 Votes
Pointers in c#
0 Votes
Drawing images in java
2 Votes