DEV Community

Discussion on: Daily Challenge #11 - Cubic Numbers

Collapse
 
edh_developer profile image
edh_developer
def cubic(x):
        total = 0
        tmp = x
        while ( tmp % 10 ) > 0 :
                total += (tmp % 10) **3
                tmp = ( tmp // 10)

        return ("lucky" if (total == x) else "unlucky")
Collapse
 
devparkk profile image
Dev Prakash

Wow ... That's too good ...
But how about the secondary objective ? .. .