Python - Function Practice - What's wrong with this code? [solved]

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

def by_three(number):
  number=int(raw_input ("enter a number that is divisble by three"))
  if number % 3 == 0:
    return cube(number)
  else:
    print "enter a valid number"
  by_three()

how do i make sure this loops and asks to enter valid number the get the cube

So currently, you ask for the function to be supplied with an argument of a number, but then promptly overwrite it with the raw_input request. If you ran the function within the same indentation as the else statement then it would run again if the else statement gets run. Just be careful of entering an infinite loop.