Name: Anonymous 2011-12-05 10:39
Seriously asking, for the people that like python, why do you like it, and what do you normally use it for?
### Start with... ###
class Anus:
def __init__(self):
self.haxxed = True
myAnus = Anus()
if myAnus.haxxed is True:
print 'NO EXCEPTIONS'if myAnus.haxxed: and it would work in both cases above/below.)
### Changes to... ###
class Anus:
def __init__(self):
self.haxxed = "thoroughly"
myAnus = Anus()
if myAnus.haxxed == "thoroughly":
print 'NO EXCEPTIONS'
### Should've been doing this all along... ###
class Anus:
def __init__(self):
self.haxxed = "thoroughly"
def isHaxxed(self):
return self.haxxed == "thoroughly"
myAnus = Anus()
if myAnus.isHaxxed:
print 'NO EXCEPTIONS'