How to Create a Love Calculator using lower() and count() Functions in Python

Create a Love Calculator using lower() and count() Functions in Python

This blog will help you to learn about functions like lower, and count using that, We will be creating a love calculator (Which would be Fun !!)


  • lower()
  • count()


This function will convert the input string into lowercase. This helps to reduce the complexity for users So that they can try in any case they want.

For example

print(“PyTHOn”.lower() )



This function will print the number of times specified input occurs in a string or a variable





print("Welcome to the Love Calculator!")

name1 = input("What is your name? \n")

name2 = input("What is their name? \n")





if int(score) < 10 or int(score) > 90:

print (f"Your score is {score}, you go together like coke and mentos.")

elif int(score) > 40 and int(score) <50:

print (f"Your score is {score}, you are alright together.")


print (f"Your score is {score}.")

Try it yourself


Let’s see, How this Love Calculator works:

– To create a love calculator, We need to get 2 names as an input

– Find the number of times the letter “T R U E ” & “L O V E” is occurring in both the name

– Then combine these numbers to make a 2-digit number.

– Once done, Based on the score, We need to share the Love levels

  • For a Score of less than 10 or greater than 90, then we need to show as the message below

“Your score is {score}, you go together like coke and mentos.”

  • For a Score between 40 and 50, the message should be:

“Your score is {score}, you are alright together.”

  • Otherwise, We can just print the score

“Your score is {score}.”

Check here for more Python learning series posts

Good Luck with your learning. Hit like if this post is helpful

Similar Posts