Practice Makes Perfect... please help


#1

Oops, try again. cube(1) resulted in an error: global name 'n' is not defined

I dont know what else to do.

Here is my code:

def cube(number):
    return cube(n)

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

#2

Have you read the error message?
Do you agree with it?
Do you see where you are doing what it suggests you're doing?
Would you argue for that you can do what you're doing?
What information are you missing to fix it?


#3

Yes, I've read the message, and yes, I agree with it, but no, I don't see what I'm doing and why it is suggesting it...

Could you help with that part first please???


#4

global name 'n' is not defined

This suggests there was an attempt to read it, but that's not possible if it hasn't been defined


#5

Hint
Question 2 asks you to return the cube of of NUMBER

return_____**3

That should fire you up (0v0)/~


#6

OK!!!
Thanks guys!
I've got it now!!!


#7

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