I have an assignment which I am tasked to create a calculator that calculates the compatibility of two names while using functions. The objectives would be to ask the user for two names. From the input, count the number of Tβs, Rβs, Uβs, Eβs, Lβs, O's, Vβs, and Eβs (again) from the names. Add the numbers with each other until I end up with 2 digits then when adding, discard the tens digit and only retain the 1βs digit.
Ex. 6 + 8 = 4. 6 + 4 = 0.
Using the optional template provided by teacher:
def main():
person1 = input("Input name of Person 1: ")
person2 = input("Input name of Person 2: ")
compatibility = calculate(person1, person2)
print(person1, "and", person2, "are", compatibility, "% compatible")
def calculate(person1, person2):
return 0
main()
I started running into some confusion in VSCode where it keeps saying syntax error unless I run it in debug. On the other hand, the code works nevertheless. Putting that aside, I tried reviewing my readings from my prof but then realized that the lessons had no exercises nor further examples on how I can use my learnings to approach this task.