Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. def sum_of_digits(n):
  2.     sum = 0
  3.     while n > 0:
  4.         sum += n % 10
  5.         n = n // 10
  6.     return sum
  7.  
  8.  
  9. def sum_of_digits_till_inf(n):
  10.     while n >= 10:
  11.         n = sum_of_digits(n)
  12.     return n
  13.  
  14.  
  15. def numerology_of_date(date):
  16.     d = sum_of_digits_till_inf(date["day"])
  17.     m = sum_of_digits_till_inf(date["month"])
  18.     y = sum_of_digits_till_inf(date["year"])
  19.     return sum_of_digits_till_inf(d + m + y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement