• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu

Q&A Discussions

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
magic-methodspython
1 Vote
6 Answers
5th Jul 2016, 6:57 AM
yogaocean
yogaocean - avatar
< Previous12Next >
Hot today
Question
3 Votes
Hi guys I need some one to teach the String name how I can do it true because when I finish coding they give me NO OUTPUT
3 Votes
overloading operators << >>
1 Votes
generic programming understanding memory ownership
0 Votes
I dont now that how to do js
2 Votes
fully dynamic arrays
1 Votes
Wishkit alternative for android
1 Votes
How to start in web dev?
0 Votes
Hi
0 Votes
Issue in code
0 Votes