Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcjęDyskusje Q&A
Random list magic-method
0 głosów
1 Odpowiedź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 Głos
5 odpowiedziNeed help
1 Głos
1 OdpowiedźNeed help
0 głosów
1 OdpowiedźWhats wrong with this
3 głosów
7 odpowiedzimagic methods
0 głosów
2 odpowiedziWhat is an r method?
3 głosów
3 odpowiedziWhy do we override?
2 głosów
3 odpowiedziis there any wrong
0 głosów
2 odpowiedziPopularne dzisiaj
Code
2 Votes
Solution
0 Votes
Calculator
0 Votes
How to make animation
0 Votes
Sololearn logo
0 Votes