My code is an advanced love calculator that generates a result based on the similarities between the two names. Is this correct?Is my Encryption Module Secure?Is this code for a calculator efficient?Autocomplete Trie OptimizationUltimate FizzBuzzGenerating frequency tables based on CSV datasetDataset and frequency list generation by looping over filesCode that checks input for calculator appImproved version of “Let's read a random Goodreads book…”Markov country name generatorBasic calculator that calculates result based on operands using a class
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
What does the "remote control" for a QF-4 look like?
"You are your self first supporter", a more proper way to say it
When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?
How much RAM could one put in a typical 80386 setup?
Operational amplifier as a comparator at high frequency
What typically incentivizes a professor to change jobs to a lower ranking university?
Can I make popcorn with any corn?
Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?
if condition in the past
What's the point of deactivating Num Lock on login screens?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
Today is the Center
Arrow those variables!
Why does Kotter return in Welcome Back Kotter?
Convert two switches to a dual stack, and add outlet - possible here?
Could an aircraft fly or hover using only jets of compressed air?
Can I ask the recruiters in my resume to put the reason why I am rejected?
Mutually beneficial digestive system symbiotes
Does detail obscure or enhance action?
Get value of a counter
Can you really stack all of this on an Opportunity Attack?
Why doesn't H₄O²⁺ exist?
Can the number of solutions to a system of PDEs be bounded using the characteristic variety?
My code is an advanced love calculator that generates a result based on the similarities between the two names. Is this correct?
Is my Encryption Module Secure?Is this code for a calculator efficient?Autocomplete Trie OptimizationUltimate FizzBuzzGenerating frequency tables based on CSV datasetDataset and frequency list generation by looping over filesCode that checks input for calculator appImproved version of “Let's read a random Goodreads book…”Markov country name generatorBasic calculator that calculates result based on operands using a class
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
My love calculator gives a result from 0 to 100% based on these factors:
- If the first letters of the names are the same.
- If the number of vowels is the same.
- If the length of the name is the same.
- If the number of consonants is the same.
Also, there is an extra boost of 10-50%, so the result is also partially as a result of luck.
Can the coding below be simplified or improved to function more smoothly?:
name1 = input("Please type Name 1.n")
name2 = input("Please type Name 2.n")
total_vowel1 =0
for i in ['a','e','i','o','u']:
total_vowel1 += name1.count(i)
total_vowel2 =0
for i in ['a','e','i','o','u']:
total_vowel2 += name2.count(i)
love = 0
if(total_vowel1 == total_vowel2):
import random
love +=random.randint(10,30)
consonants1 = 0
consonants2 = 0
CONSONANTS = 'bcdfghjklmnprstvwxyz'
consonants1 = len([letter for letter in name1 if letter.lower() in
CONSONANTS])
consonants2 = len([letter for letter in name2 if letter.lower() in
CONSONANTS])
if(consonants1 == consonants2):
import random
love +=random.randint(20,40)
line1 = name1
line2 = name2
split1 = line1.split()
split2 = line2.split()
fl1 = [word[0] for word in split1]
fl2 = [word[0] for word in split2]
if (fl1 == fl2):
import random
love +=random.randint(10,30)
if (len(name1) == len(name2)):
import random
love+=random.randint(1,10)
import random
love +=random.randint(10,50)
if (love>100):
love = 100
print("Calculating...")
import time
import random
time.sleep(random.randint(1,3))
print("",name1,"and",name2,"have a",love,"% relationship.")
if ((love>90) or (love == 90)):
print("They have an unbreakable relationship that will last
forever.")
if ((love<89) or (love == 89)) and ((love>70) or (love == 70)):
print("They have a strong relationship that will most likely
lead to a marriage.")
if ((love<69) or (love == 69)) and ((love>50) or (love == 50)):
print("They have a good relationship that can lead to a
honeymoon to Paris.")
if ((love<49) or (love == 49)):
print("They have a weak relationship that could have been a
'match made in heaven'.")
python calculator generator
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
My love calculator gives a result from 0 to 100% based on these factors:
- If the first letters of the names are the same.
- If the number of vowels is the same.
- If the length of the name is the same.
- If the number of consonants is the same.
Also, there is an extra boost of 10-50%, so the result is also partially as a result of luck.
Can the coding below be simplified or improved to function more smoothly?:
name1 = input("Please type Name 1.n")
name2 = input("Please type Name 2.n")
total_vowel1 =0
for i in ['a','e','i','o','u']:
total_vowel1 += name1.count(i)
total_vowel2 =0
for i in ['a','e','i','o','u']:
total_vowel2 += name2.count(i)
love = 0
if(total_vowel1 == total_vowel2):
import random
love +=random.randint(10,30)
consonants1 = 0
consonants2 = 0
CONSONANTS = 'bcdfghjklmnprstvwxyz'
consonants1 = len([letter for letter in name1 if letter.lower() in
CONSONANTS])
consonants2 = len([letter for letter in name2 if letter.lower() in
CONSONANTS])
if(consonants1 == consonants2):
import random
love +=random.randint(20,40)
line1 = name1
line2 = name2
split1 = line1.split()
split2 = line2.split()
fl1 = [word[0] for word in split1]
fl2 = [word[0] for word in split2]
if (fl1 == fl2):
import random
love +=random.randint(10,30)
if (len(name1) == len(name2)):
import random
love+=random.randint(1,10)
import random
love +=random.randint(10,50)
if (love>100):
love = 100
print("Calculating...")
import time
import random
time.sleep(random.randint(1,3))
print("",name1,"and",name2,"have a",love,"% relationship.")
if ((love>90) or (love == 90)):
print("They have an unbreakable relationship that will last
forever.")
if ((love<89) or (love == 89)) and ((love>70) or (love == 70)):
print("They have a strong relationship that will most likely
lead to a marriage.")
if ((love<69) or (love == 69)) and ((love>50) or (love == 50)):
print("They have a good relationship that can lead to a
honeymoon to Paris.")
if ((love<49) or (love == 49)):
print("They have a weak relationship that could have been a
'match made in heaven'.")
python calculator generator
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
My love calculator gives a result from 0 to 100% based on these factors:
- If the first letters of the names are the same.
- If the number of vowels is the same.
- If the length of the name is the same.
- If the number of consonants is the same.
Also, there is an extra boost of 10-50%, so the result is also partially as a result of luck.
Can the coding below be simplified or improved to function more smoothly?:
name1 = input("Please type Name 1.n")
name2 = input("Please type Name 2.n")
total_vowel1 =0
for i in ['a','e','i','o','u']:
total_vowel1 += name1.count(i)
total_vowel2 =0
for i in ['a','e','i','o','u']:
total_vowel2 += name2.count(i)
love = 0
if(total_vowel1 == total_vowel2):
import random
love +=random.randint(10,30)
consonants1 = 0
consonants2 = 0
CONSONANTS = 'bcdfghjklmnprstvwxyz'
consonants1 = len([letter for letter in name1 if letter.lower() in
CONSONANTS])
consonants2 = len([letter for letter in name2 if letter.lower() in
CONSONANTS])
if(consonants1 == consonants2):
import random
love +=random.randint(20,40)
line1 = name1
line2 = name2
split1 = line1.split()
split2 = line2.split()
fl1 = [word[0] for word in split1]
fl2 = [word[0] for word in split2]
if (fl1 == fl2):
import random
love +=random.randint(10,30)
if (len(name1) == len(name2)):
import random
love+=random.randint(1,10)
import random
love +=random.randint(10,50)
if (love>100):
love = 100
print("Calculating...")
import time
import random
time.sleep(random.randint(1,3))
print("",name1,"and",name2,"have a",love,"% relationship.")
if ((love>90) or (love == 90)):
print("They have an unbreakable relationship that will last
forever.")
if ((love<89) or (love == 89)) and ((love>70) or (love == 70)):
print("They have a strong relationship that will most likely
lead to a marriage.")
if ((love<69) or (love == 69)) and ((love>50) or (love == 50)):
print("They have a good relationship that can lead to a
honeymoon to Paris.")
if ((love<49) or (love == 49)):
print("They have a weak relationship that could have been a
'match made in heaven'.")
python calculator generator
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
My love calculator gives a result from 0 to 100% based on these factors:
- If the first letters of the names are the same.
- If the number of vowels is the same.
- If the length of the name is the same.
- If the number of consonants is the same.
Also, there is an extra boost of 10-50%, so the result is also partially as a result of luck.
Can the coding below be simplified or improved to function more smoothly?:
name1 = input("Please type Name 1.n")
name2 = input("Please type Name 2.n")
total_vowel1 =0
for i in ['a','e','i','o','u']:
total_vowel1 += name1.count(i)
total_vowel2 =0
for i in ['a','e','i','o','u']:
total_vowel2 += name2.count(i)
love = 0
if(total_vowel1 == total_vowel2):
import random
love +=random.randint(10,30)
consonants1 = 0
consonants2 = 0
CONSONANTS = 'bcdfghjklmnprstvwxyz'
consonants1 = len([letter for letter in name1 if letter.lower() in
CONSONANTS])
consonants2 = len([letter for letter in name2 if letter.lower() in
CONSONANTS])
if(consonants1 == consonants2):
import random
love +=random.randint(20,40)
line1 = name1
line2 = name2
split1 = line1.split()
split2 = line2.split()
fl1 = [word[0] for word in split1]
fl2 = [word[0] for word in split2]
if (fl1 == fl2):
import random
love +=random.randint(10,30)
if (len(name1) == len(name2)):
import random
love+=random.randint(1,10)
import random
love +=random.randint(10,50)
if (love>100):
love = 100
print("Calculating...")
import time
import random
time.sleep(random.randint(1,3))
print("",name1,"and",name2,"have a",love,"% relationship.")
if ((love>90) or (love == 90)):
print("They have an unbreakable relationship that will last
forever.")
if ((love<89) or (love == 89)) and ((love>70) or (love == 70)):
print("They have a strong relationship that will most likely
lead to a marriage.")
if ((love<69) or (love == 69)) and ((love>50) or (love == 50)):
print("They have a good relationship that can lead to a
honeymoon to Paris.")
if ((love<49) or (love == 49)):
print("They have a weak relationship that could have been a
'match made in heaven'.")
python calculator generator
python calculator generator
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 3 mins ago
MustafaMustafa
11
11
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Mustafa is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f216946%2fmy-code-is-an-advanced-love-calculator-that-generates-a-result-based-on-the-simi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Mustafa is a new contributor. Be nice, and check out our Code of Conduct.
Mustafa is a new contributor. Be nice, and check out our Code of Conduct.
Mustafa is a new contributor. Be nice, and check out our Code of Conduct.
Mustafa is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f216946%2fmy-code-is-an-advanced-love-calculator-that-generates-a-result-based-on-the-simi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown