Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cifre(n):
- #@param n: int
- #@return list
- r, m = n, []
- while(r!=0):
- m.append(r%10)
- r = r/10
- return m
- def divisibile3(n):
- #@param n: int
- #@return: bool
- if n<10:
- if n<3:
- return False
- elif n == 3 or n == 6 or n == 9:
- return True
- else:
- return False
- else:
- somma = 0
- for i in cifre(n):
- somma+=i
- return divisibile3(somma)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement