+ 1
whats wrong in this code...python
number = int(input("Enter a number:") def cube(number): print number**3 def by_three(number): if number%3 == 0: print "number is divisible by three" else : print "number is not divisible
9 Respostas
+ 1
You missed a closing parenthesis in the first line as well.
+ 1
yeah got it... :)
0
code seems to be okay. Only thing is, that in Python 3.x print is a function, means you have to use parenthesis:
print ('something')
and you'll have to call your defined functions if you want them to work...
0
but @amarie the error shown is the 'def cube' ... like they are showing syntaxError: invalid syntax
0
you also use parentheses for the print () function?
0
print (number**3)
0
yes yes I did all these
0
stiil there's a error in statement 'def cube'
0
@merkrafter seems to have found the actual problem :)