I'm new to python and I'm really struggling with this issue. I want to find whether a certain word from string1 exists in string2. And I need to compare each word of string1 with string2?
count = len(string2.split())
print(count)
c=0
string1 = "I had a nice day. Infact, I had a great day! Yes sir."
string2 = "nice great sir day lol"
count = len(string2.split())
print(count)
c=0
i =1
while i<=count:
if string2[i].split(" ") in string1.split(" "):
c+= 1
i += 1
print(c)