import string Name1=raw_input() Name2=raw_input() Name1=string.replace(Name1," ","") Name2=string.replace(Name2," ","") Name1=Name1.lower() Name2=Name2.lower() print Name1 print Name2 Name1_List=list(Name1) Name2_List=list(Name2) for i in Name1: for j in Name2: if i==j: del Name1_List[Name1_List.index(i)] del Name2_List[Name2_List.index(j)] break print Name1_List print Name2_List flames_count=len(Name1_List)+len(Name2_List) print "Count to be considered in playing FLAMES is = ",flames_count flames=['F','L','A','M','E','S'] print "FLAMES Array values are = ",flames length1=len(flames) print "FLAMES Array count = ",length1 count=0 print "" print "" print "Iteration 1 :" print "" print "" while len(flames)==6: for x in range(1,flames_count+1): if x==1: if count==len(flames): count=0 else: if count==5: count=5 else: count=count else: if count==5: count=0 else: count=count+1 print "The count for x value ",x," is = ",count del flames[count] print"" print "Iteration 1 Remaining FLAMES List = ",flames print"" print "Last Deleted Array Index = ",count print "" print "" print "Iteration 2 :" print "" print "" while len(flames)==5: for x in range(1,flames_count+1): if x==1: if count==len(flames): count=0 else: if count==4: count=4 else: count=count else: if count==4: count=0 else: count=count+1 print "The count for x value ",x," is = ",count del flames[count] print"" print "Iteration 2 Remaining FLAMES List = ",flames print"" print "Last Deleted Array Index = ",count print "" print "" print "Iteration 3 :" print "" print "" while len(flames)==4: for x in range(1,flames_count+1): if x==1: if count==len(flames): count=0 else: if count==3: count=3 else: count=count else: if count==3: count=0 else: count=count+1 print "The count for x value ",x," is = ",count del flames[count] print"" print "Iteration 3 Remaining FLAMES List = ",flames print"" print "Last Deleted Array Index = ",count print "" print "" print "Iteration 4 :" print "" print "" while len(flames)==3: for x in range(1,flames_count+1): if x==1: if count==len(flames): count=0 else: if count==2: count=2 else: count=count else: if count==2: count=0 else: count=count+1 print "The count for x value ",x," is = ",count del flames[count] print"" print "Iteration 4 Remaining FLAMES List = ",flames print"" print "Last Deleted Array Index = ",count print "" print "" print "Iteration 5 :" print "" print "" while len(flames)==2: for x in range(1,flames_count+1): if x==1: if count==len(flames): count=0 else: if count==1: count=1 else: count=count else: if count==1: count=0 else: count=count+1 print "The count for x value ",x," is = ",count del flames[count] print"" print "Iteration 5 Remaining FLAMES List = ",flames print"" print "Last Deleted Array Index = ",count print "" print "" print "The Result of FLAMES is:" print "" print "" if flames[0]=='F': print "The relationshiop between ",Name1," and ",Name2," is = Friends" elif flames[0]=='L': print "The relationshiop between ",Name1," and ",Name2," is = Love" elif flames[0]=='A': print "The relationshiop between ",Name1," and ",Name2," is = Affection" elif flames[0]=='M': print "The relationshiop between ",Name1," and ",Name2," is = Marraige" elif flames[0]=='E': print "The relationshiop between ",Name1," and ",Name2," is = Enemy" else: print "The relationshiop between ",Name1," and ",Name2," is = Sacrifice"
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question