Can anybody describe this code to me? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

2nd Jul 2020, 2:34 PM
Shafayet Arish
Shafayet Arish - avatar
2 Answers
+ 1
It is python
2nd Jul 2020, 3:05 PM
Shafayet Arish
Shafayet Arish - avatar
0
Please specify a relevant language in the thread tags 👍
2nd Jul 2020, 2:41 PM
Ipang