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;








0












$begingroup$


My love calculator gives a result from 0 to 100% based on these factors:



  1. If the first letters of the names are the same.

  2. If the number of vowels is the same.

  3. If the length of the name is the same.

  4. 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'.")








share







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$


















    0












    $begingroup$


    My love calculator gives a result from 0 to 100% based on these factors:



    1. If the first letters of the names are the same.

    2. If the number of vowels is the same.

    3. If the length of the name is the same.

    4. 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'.")








    share







    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$














      0












      0








      0





      $begingroup$


      My love calculator gives a result from 0 to 100% based on these factors:



      1. If the first letters of the names are the same.

      2. If the number of vowels is the same.

      3. If the length of the name is the same.

      4. 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'.")








      share







      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:



      1. If the first letters of the names are the same.

      2. If the number of vowels is the same.

      3. If the length of the name is the same.

      4. 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





      share







      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.










      share







      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.








      share



      share






      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.




















          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.









          draft saved

          draft discarded


















          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.









          draft saved

          draft discarded


















          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          名間水力發電廠 目录 沿革 設施 鄰近設施 註釋 外部連結 导航菜单23°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.7113923°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.71139計畫概要原始内容臺灣第一座BOT 模式開發的水力發電廠-名間水力電廠名間水力發電廠 水利署首件BOT案原始内容《小檔案》名間電廠 首座BOT水力發電廠原始内容名間電廠BOT - 經濟部水利署中區水資源局

          格濟夫卡 參考資料 导航菜单51°3′40″N 34°2′21″E / 51.06111°N 34.03917°E / 51.06111; 34.03917ГезівкаПогода в селі 编辑或修订