6. Practice Makes Perfect Help



Indentation Error, expected indented block.

Well I don't know why it's weirded out by my indentations... but to be honest I'm more worried if have the "by_three(cube[number])" part right and whether or not I've put it in the logical spot.

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


Ok so instead of doing these two lines above you should just return the cube(number). Also, at least for me I had my syntax set up a different way:

def cube(number):
    return whatever
def whatever:
    if whatever:
        return whatever
        return whatever


I've been working on this one for hours!!! And it's the first time I ever used a forum. OMG this is the best!!! Thanks for helping me!!!!


Haha no problem man! I know I hate being stuck on stuff for long periods of time so I am glad to help another! Hopefully your other lessons go smoother and if you have any questions you know where to go :sunglasses: happy coding! :smiley:


Thanks man! Was stuck on that section for a while.


here raw_input(number) takes number as a string in python 2 so, use int(raw_input)


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