Love Percentage - Python Code

Love Percentage Calculator




Hi Friends
Welcome, Today we are calculate love percetage with your favourite person
This code very simple way...
let's try... in your python console or our console in website top...

CODE:


from collections import Counter
a = input('Enter your name: ').replace(' ','').lower()
b = input('Enter your name: ').replace(' ','').lower()
c = [i for i in a]
d = [i for i in b]
n = len(c) + len(d)
d1 = Counter(c)
d2 = Counter(d)
c1 = list((d1 & d2).elements())
score = ((2 * len(c1)) / n) * 100
r = round(score,2)
print(f'love Percentage with {b}: {r} %')


-----

By
PyKAR

Comments

Popular posts from this blog

Hardy - Ramanujan Number (Magic Number) Program in Python

FLAMES CODE ON PYTHON

Count Swap for Sorting in Python