+ 1

python dr. love

Hey guys, so at school, we are working on python algorithms and we have been told to create one that determines the love percentage between two people. Thanks in advance for the help.

9th Sep 2017, 11:56 AM
Jack
Jack - avatar
5 Antworten
+ 11
Hmm, string input for both names. Sum up all ASCII values of the characters in each name and store into two variables, sum1 and sum2. Divide the smaller value with the larger value to get a float, multiply by 100 and store into love_p. This would be the love percentage.
9th Sep 2017, 12:39 PM
Hatsy Rei
Hatsy Rei - avatar
+ 10
Interesting. What would be the algorithm used to determine 'love percentage' though? Or are we free to implement any kind of algorithm?
9th Sep 2017, 12:33 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
I want it to be the same every time though
9th Sep 2017, 12:20 PM
Jack
Jack - avatar
+ 1
What I am asking for is an algorithm, go crazy
9th Sep 2017, 12:35 PM
Jack
Jack - avatar
+ 1
This sounds good, thank you
9th Sep 2017, 12:40 PM
Jack
Jack - avatar