Skip to content
Love Calculator ❤️
gabrielbarsani
gabrielbarsani
Made with
Python
Python
Published on Mar 26, 2022
  • #python
  • #apps

This calculator basically works likes this: it'll check how many letters of your name and your supposed loved one match with the sentence "True Love". You get in the end a number (total points). The higher your score, the best are your chances together :)

71comments
SanaGrover
SanaGrover
2 weeks ago

"your score is 1, you go together like coke and mentos" that came up when i typed in my ex bf so tyyyyy

AaronWang35
AaronWang35
3 weeks ago

i got 2020

Vargskelethor
Vargskelethor
4 weeks ago

Comment #69

Rigel-Developer
Rigel-Developer
1 month ago

Este programa puede terminar relaciones eh, cuidado

21oliverf
21oliverf
1 month ago

Fin

Overo3
Overo3
1 month ago

10001000

KrishWadia
KrishWadia
1 month ago

22 D:

TubboMomment
TubboMomment
2 months ago

ngl this anit real even tho you think it is dont break off your relationships just cuz of the number

TubboMomment
TubboMomment
2 months ago

I got like 60 for saying crush and thats my bf lol

Elilijah
Elilijah
2 months ago

22, Damn

PriyanshuDandap
PriyanshuDandap
2 months ago

Sorry but I know you are doing the 100 days of code but sorry in one of the future days Angela told me that The Love calculator was just predictions LOL

STUDENT-ChloeCh
STUDENT-ChloeCh
2 months ago

24

SimplyPL
SimplyPL
2 months ago

33 with my crush TOT

Turtsle
Turtsle
2 months ago

6526

demiansebat1
demiansebat1
2 months ago

12... ouch.

AajinkyaNaik
AajinkyaNaik
2 months ago

you could've done input().lower() 2 times , which combines lines 2,3 with lines 5,6

ZackLopez
ZackLopez
2 months ago

20

pythoncoder11
pythoncoder11
2 months ago

23

GoodwinGuy
GoodwinGuy
2 months ago

24

GoodwinGuy
GoodwinGuy
2 months ago

24

IhanKaelRivero
IhanKaelRivero
2 months ago

13....

Vargskelethor
Vargskelethor
2 months ago

Screenshot 2022-04-19 19.08.36 Uh-oh...

eliaslee123
eliaslee123
2 months ago

Put 'Love True' for both and get score 1010! Yay!

WhyWatermelon
WhyWatermelon
2 months ago

93

LucasXue1
LucasXue1
2 months ago

I did ddd for both names and it said 'Your score is 0, you go together like coke and mentos'

JonathanBlanka
JonathanBlanka
3 months ago

If you just put true love for both names you get 1010 points lol

dstarpython128
dstarpython128
3 months ago

my score = 73 lol

SpartyJ
SpartyJ
3 months ago

if you get the first 4 paragraphs of the definition of love from Wikipedia, copy paste it you get a score of 11,841,216.

LilyBai
LilyBai
3 months ago

I did: Welcome to the Love Calculator! What is your name? fnveilsgve What is their name? sdrhhw6nt4seh tstrig dryk your score is 96, you go together like coke and mentos.

Xytrophico
Xytrophico
3 months ago

Welcome to the Love Calculator! What is your name? wkrjfhwkejhkwejhfkwejf wekfjwhefkjwhefkjfw wefkjhwekfjhwkejdfowiehfowiurhfoiweofihwe wefoiwherofiueroifhoweihfoiewhrfoubwe fweofiwjeof What is their name? wkrjfhwkejhkwejhfkwejf wekfjwhefkjwhefkjfw wefkjhwekfjhwkejdfowiehfowiurhfoiweofihwe wefoiwherofiueroifhoweihfoiewhrfoubwe fweofiwjeof Your score is 5664, you go together like coke and mentos.

GabrielBarbos33
GabrielBarbos33
3 months ago

image Glitched easy

Torinitei
Torinitei
3 months ago

God help those whose names are written in a glyphic language, lol

graysoncoletta
graysoncoletta
3 months ago

So "True Love" and "True Love" are the only two people who can go well together.

MrCeuz
MrCeuz
3 months ago

image 😳

MrCeuz
MrCeuz
3 months ago

This file cannot be displayed: image image

LisleWang
LisleWang
3 months ago

i did my ex-crush and got 26

LilyBai
LilyBai
3 months ago

Cool! But mine went like WHOOP and ended up in a disaster! ✿

SirAnos
SirAnos
3 months ago

1312 Lets Gooooooo

EmilyRUSSELL2
EmilyRUSSELL2
3 months ago

Hey, Did you know that if you put yours/thiers full name you get more points??? #Justsaying

PattaweeSittiri
PattaweeSittiri
3 months ago

Cool! But did you know that

print("Welcome to the Love Calculator!") name1 = input("What is your name? \n") name2 = input("What is their name? \n")

combined_names = name1 + name2 lower_names = combined_names.lower() t = lower_names.count("t") r = lower_names.count("r") u = lower_names.count("u") e = lower_names.count("e") first_digit = t + r + u + e

l = lower_names.count("l") o = lower_names.count("o") v = lower_names.count("v") e = lower_names.count("e") second_digit = l + o + v + e

score = int(str(first_digit) + str(second_digit))

if (score < 10) or (score > 90): print(f"Your score is {score}, you go together like coke and mentos.") elif (score >= 40) and (score <= 50): print(f"Your score is {score}, you are alright together.") else: print(f"Your score is {score}.")

with open('testing_copy.py', 'w') as file: file.write('def test_func():\n') with open('main.py', 'r') as original: f2 = original.readlines()[0:45] for x in f2: file.write(" " + x)

import testing_copy import unittest from unittest.mock import patch from io import StringIO import os

class MyTest(unittest.TestCase): def run_test(self, given_answer, expected_print): with patch('builtins.input', side_effect=given_answer), patch('sys.stdout', new=StringIO()) as fake_out: testing_copy.test_func() self.assertEqual(fake_out.getvalue(), expected_print)

def test_1(self): self.run_test(given_answer=['David Beckham', 'Victoria Beckham'], expected_print='Welcome to the Love Calculator!\nYour score is 45, you are alright together.\n')

def test_2(self): self.run_test(given_answer=['Han Solo', 'Princess Leia Organa'], expected_print='Welcome to the Love Calculator!\nYour score is 47, you are alright together.\n')

def test_3(self): self.run_test(given_answer=['Pierre Curie', 'Marie Curie'], expected_print='Welcome to the Love Calculator!\nYour score is 125, you go together like coke and mentos.\n')

def test_4(self): self.run_test(given_answer=['Mark Antony', 'Cleopatra'], expected_print='Welcome to the Love Calculator!\nYour score is 54.\n')

print('\n\n\n.\n.\n.') print('Checking if your print statements match the instructions. \nFor "Mario" and "Princess Peach" your program should print this line exactly:\n') print('Your score is 43, you are alright together.\n') print('\nRunning some tests on your code with different name combinations:') print('.\n.\n.') unittest.main(verbosity=1, exit=False)

os.remove('testing_copy.py')

TySingh
TySingh
3 months ago

Just mildly curious, but did you know of for loops when you made this?