Practice Makes Perfect


#1

Guys im just trying all i can imagine, i dont want to look someone else answer without understanding. can you please help me.

def cube(number):
  return cube(number)

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

  else:
    return False

#2

here:

def cube(number):
  return cube(number)

this function calls itself, and give there is no way for this to end, you have a sort of infinity loop, but then with functions.

cube means number to the power of 3, how do we do power of three in python?


#3
def cube(number):
  return number ** 3

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


Got it thank you so much

#4