Maor Beeri2,154 Points
got a problem
I get this message error and don't know what to do :( need someone's assistance
# EXAMPLES # squared(5) would return 25 # squared("2") would return 4 # squared("tim") would return "timtimtim" def squared (x): try: num = int(x) except ValueError: return num * len(num) else: return num*num
Steven Parker155,426 Points
You're very close! But when the exception occurs, the variable "num" does not get assigned. So the code in the exception block should work with argument "x" directly instead.
Dave StSomeWhere19,221 Points
Double check what you are doing to handle the exception and pay attention to the bummer error message, it is telling you the issue.