Your code looks a bit off. Check the console window for errors!

```
def cube(number):
return cube
def by_three(number):
if by_three = cube(number):
return True
else:
return False
```

Your code looks a bit off. Check the console window for errors!

```
def cube(number):
return cube
def by_three(number):
if by_three = cube(number):
return True
else:
return False
```

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

Using "n" will throw an error as "n" is not defined. Use "number" where "n" is used in this example. Also, in the printed message, it will simply say "n is...". You could use string formatting to input the actual number.

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

Not in the instructions. If `number`

is divisible by `3`

we are asked to return its cube, otherwise return `False`

(as I recall).

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