Welcome to the Treehouse Community
Looking to learn something new?
Hunter Gass4,878 Points
really struggling with this last objective. I don't know what im doing wrong any help would be much appreiated!
def squared(x): try: x = int(x) except: return len(x) ** 2 else: return x * x print squared(5) print squared("3") print squared("boo")
Steven Parker216,083 Points
You have an issue with the value you return on an exception.
The instructions say to "return the argument multiplied by its length". But your statement is returning the square of the length instead. You probably want something more like this:
return len(x) * x