I want a code that input the number of lines (empty ones are counted), then the lines itself, then the word I want to find and finally, where the first occurrence of one character happened. Please with no import
s.
I have this rn:
lines = int(input())
phrases = []
for i in range(lines):
phrase = str(input())
phrase = phrase.replace(',','')
phrase = phrase.replace('!','')
phrase = phrase.replace('.','')
phrase = phrase.replace(';','')
phrase = phrase.replace(':','')
phrase = phrase.replace('?','')
phrase = phrase.replace(' ','')
phrase = phrase.lower()
phrases.append(phrase)
word = str(input())
So the input will be like:
6
I have a computer
Hello world
Please help
Dammit code
I wish I finished this today
happy
I want the results to be like:
Word founded
h: word 2, letter 1
a: word 3, letter 1
p: word 4, letter 4
p: word 7, letter 1
y: word 16, letter 5
It can't be in the same word as the last one.
In the case where this doesn't happen, print:
Word not founded