-
Notifications
You must be signed in to change notification settings - Fork 39
/
lovecal.py
53 lines (41 loc) · 1.16 KB
/
lovecal.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
def cal(name1,name2):
combStr = name1 + "loves" + name2
strCount = ""
for c1 in combStr:
if combStr.count(c1) != 0:
strCount+=str(combStr.count(c1))
combStr = combStr.replace(c1,"")
n= list(map(int,strCount))
while len(n)>2:
n = shortn(n)
per = int(''.join(map(str,n)))
return per
def shortn(n):
i=0
i=0
j=len(n)-1
n1=[]
while i<=j :
per = n[i]+n[j]
if i==j:
per = n[i]
n1.append(per)
i+=1
j-=1
return n1
if __name__ == "__main__":
n1=input("Enter your name: ").lower()
n2=input("Enter your Partner/Crush name: ").lower()
print(f" \n{n1.upper()} and {n2.upper()}")
print(f"""
love meter:
_____ ______
( \ / )
\ \ / /
\ /
\ {cal(n1,n2)}% /
\ /
\ /
\ /
\ /
\/ """ )