Problem with printing


#1

I’ve tried to print something after the function so I could know that the function is working, but nothing happens. I wonder what am I doing wrong and how can I get the result I want
Here’s the code:

def cube(number):
return number**3

def by_three(number):
if number%3 == 0:
print "Number is divisible by 3"
return cube(number)
else:
print "Number is not divisible by 3"
return False

by_three(9)


#2

Other people won’t be able to run your code to see for themselves unless they have an exact copy (they also might not be able to find the cause of what you describe)


#3

How can I copy my code with saving it’s format and position?


#4

There’s a button for that in the editor, you can also put ``` on its own line before and after the code


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.