I'm confused as to how the words relate to each other, and how that number is calculated in the algorithm. Here's the full problem (I'm supposed to use for loops primarily. I think I'm supposed to avoid built-in functions.)
" For this task, we are providing you several examples of how this program should behave. We are not going to tell you exactly what the program code should contain: but your program should work as follows:
The user enters two strings (on two separate lines) "dizzy" and "zygote". Your program prints out: 2.
The user enters two strings (on two separate lines) "essentialness" and "essence". Your program prints out: 3.
The user enters two strings (on two separate lines) "platypus" and "saltwater crocodile". Your program prints out: 1.
The user enters two strings (on two separate lines) "bar" and "battery". Your program prints out: 0.
The above are examples: your program should behave similarly for any string input. Here are some more example runs:
RESTART: type something, then press return/enter: definite now type something else, then press return/enter again: finite the calculated output is 6
RESTART: type something, then press return/enter: make now type something else, then press return/enter again: matt the calculated output is 0
RESTART: type something, then press return/enter: bassline now type something else, then press return/enter again: linebass the calculated output is 4
RESTART: type something, then press return/enter: cringing now type something else, then press return/enter again: ingenious the calculated output is 3
RESTART: type something, then press return/enter: banana now type something else, then press return/enter again: nanaimo the calculated output is 4
RESTART: type something, then press return/enter: superfluous now type something else, then press return/enter again: tossup the calculated output is 0
"
Here's what I tried (it's not complete + doesn't give the answer):
word1 = input("Please enter a word! ")
word2 = input("Please enter another word! ")
count = 0
backword1 = word1[::-1]
len1 = int(len(word1))
len2 = int(len(word2))
for i in word1:
word1[:-1]
for i in word2:
word2[1:len2]
if word1[
print(count)