A problem about practice makes perfect


I just don't know where the wrong place was:
def cube(number_1):
return number_1 ** 3
def by_three(number_2):
if number_2 % 3 == 0:
print"number_2 is divisible by 3"
return cube(number_2)
print"number_2 is not"
return False


if number_2 % 3 == 0:

Don't use(FULLWIDTH COLON) instead use :


Thank You! I noticed that.


Not to grill you, or anything, but I wonder where this variable name came from...


and this,


If you are trying to make things more difficult for yourself, you are succeeding. Look for simplicity, meaning and purpose and not a way to catalog variables.

def cube(number):

That says it. The function is being handed a number and it will do something to that number. Simplicity, meaning and purpose.

def by_three(number):

Same rhetoric.

It is not necessary to invent variable names. They fall out of thin air as long as we follow the SMP model. Nothing arbitrary about it, though it is still arbitrary and subjective. Objective is the underlying current.


I've made such a low mistake which I should say sorry. Later I will put forward some meaningful questions! Thank You!


You are welcome.

I don't see any such mistakes, and have no issue with the question. Looking forward to your questions, should they arise. There is nobody here who needs to be impressed, so let them fly; and don't be judgemental of yourself. It only impedes your intuition.


A post was split to a new topic: I cannot get my problem


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