Practice makes perfect secsion something i had ignor is whitespaces are counting on Python


#1



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

def by_three(number):
    if number % 3 == 0:
       return cube(number)
    else:
       return False.


#2

In the last line return False.
You introduced a dot!
That's why it is throwing an error!
I hope it helps!:slight_smile:


#3

thanks for your help, when I paste my code I didn't delete the dot. And my code is working well


#4

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