love-calculator.py 591 B

1234567891011121314151617181920212223242526
  1. # 🚨 Don't change the code below 👇
  2. print("Welcome to the Love Calculator!")
  3. name1 = input("What is your name? \n")
  4. name2 = input("What is their name? \n")
  5. # 🚨 Don't change the code above 👆
  6. #Write your code below this line 👇
  7. names = (name1 + name2).lower()
  8. check_words = ["true", "love"]
  9. score = ""
  10. for word in check_words:
  11. digit = 0
  12. for num in range(len(word)):
  13. digit += names.count(word[num])
  14. if digit >= 10:
  15. digit = 9
  16. score += str(digit)
  17. print(score)
  18. #TODO results with annotation https://repl.it/@appbrewery/day-3-5-exercise#README.md