-
Notifications
You must be signed in to change notification settings - Fork 0
/
calculate_lucky_number.py
55 lines (38 loc) · 1.3 KB
/
calculate_lucky_number.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""This program will calculate your Life Path number with your birthday."""
name = input('Enter your name: ')
print(f"Hello! {name.title()}.")
print("""This program will calculate your Life Path number with your birthday.
Please enter your Birthday here... Day, Month and Year""")
day = int(input('Day: '))
month = int(input('Month: '))
year = int(input('Year: '))
# birthday = f"{day}\\{month}\\{year}"
# print(birthday)
"""The For Loops are using for adding digits in Day, Month and Year in this program."""
sum_of_day = 0
for i in range(len(str(day))):
digit = day % 10
sum_of_day += digit
day = day // 10
sum_of_month = 0
for i in range(len(str(month))):
digit = month % 10
sum_of_month += digit
month = month // 10
result = 0
for i in range(len(str(year))):
digit = year % 10
result += digit
year = year // 10
sum_of_year = 0
for i in range(len(str(result))):
digit = result % 10
sum_of_year += digit
result = result // 10
master_number = sum_of_day + sum_of_month + sum_of_year
sum_of_master_number = 0
for i in range(len(str(master_number))):
digit = master_number % 10
sum_of_master_number += digit
master_number = master_number // 10
print('Your Life Path number is: ', sum_of_master_number)