Can anybody describe this code to me? | SoloLearn: Learn to code for FREE!


Can anybody describe this code to me?

I am a new learner at sololearn. I am not being able to understand this code. If anybody can describe this code to me i would be thankful. 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

7/2/2020 2:34:02 PM

Shafayet Arish

2 Answers

New Answer


It is python


Please specify a relevant language in the thread tags 👍