-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlames.py
35 lines (25 loc) · 907 Bytes
/
Flames.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
def match(list1,list2):
for char in list1[:]:
if char in list2:
list1.remove(char)
list2.remove(char)
return (len(''.join(list1)) + len(''.join(list2)))
def result(count):
flames = ['FRIENDSHIP','LOVE','AFFECTION','MARRIAGE','ENEMIES','SIBLINGS']
while(len(flames) > 1):
index = (count%len(flames)) - 1
if(index >= 0):
start = flames[index + 1:]
end = flames[:index]
flames = start+end
else:
flames = flames[:len(flames) - 1]
return flames[0]
if __name__ == "__main__":
x = list(input("Enter the name of the Person 1 : ").replace(' ', '').upper())
y = list(input("Enter the name of the Person 2 : ").replace(' ', '').upper())
if(x == y):
print("Error! You need to enter different names.")
else:
count = (match(x,y))
print("Your Relationship Status : ", result(count))