I cannot get my problem


#1

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

def by_three(number):

if(number % 3 == 0):
return cube(number)
return"cube"

else:
return"False"
i cannot get my problem


A problem about practice makes perfect
#2

The objective of this lesson is to practice using the exponent operator, **, so we don't have to write,

number * number * number

What are you going to write for 6 to 9th power?

6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6

Not likely.

6 ** 9

Applying this to your function.

return number ** 3

Whenever returning a variable, we would not write it in quotes. This is a string.


#3

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