Hello everybody. Thanks for looking into the trouble I am going through.
I am getting the following error messages on python console :
Type a number: 2
Traceback (most recent call last):
File “python”, line 13, in
File “python”, line 7, in by_three
TypeError: not all arguments converted during string formatting
I would like to receive either the False boolean result or the cube of number I inserted. Here is my code :
number = raw_input("Type a number: ") def cube(number): return number**3 def by_three(number): if number % 3 == 0 : cube(number) return cube(number) else: return cube(False) cube(by_three(number)) print ("The cube of %s is %s") % (number, cube(number))
Thanks in advance.