Functions Practice makes perfect


Practice Makes Perfect

This gets outputted when I run the code:
Oops, try again. by_three(3) returned False instead of 27

def cube(number):
    #returns the cube of that number
    return number * number * number
def by_three(number):
    if number % 3 == 0:
        return False
        return number % 3 == 0


if the number is divisible by 3 return cube() of number, else you should return False


3 posts were split to a new topic: Practice makes perfect

  1. Practice makes perfect
    It need to be like that.

def cube(number):
return number*number*number
def by_three(number):
if number%3 == 0:
return cube(number)
return False


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