Question: !! The code should be in PYTHON programming language !! Mundungus Fletcher loves solving crossword puzzles, especially those with country names hidden as clues, so

!! The code should be in PYTHON programming language !!

Mundungus Fletcher loves solving crossword puzzles, especially those with country names hiddenas clues, so much so that he spends a great deal oftime every evening scanning the newspaper Daily Prophet for country names. He

Mundungus Fletcher loves solving crossword puzzles, especially those with country names hidden as clues, so much so that he spends a great deal of time every evening scanning the newspaper Daily Prophet for country names. He ignores case, spaces and punctuation marks, and delimits each country name discovered. For example, in the sentence, "The pleasures we deny ourselves are often the most tempting," country name "Sweden" appears between positions 12 and 20 (this follows the convention of slice notation--beginning position is included, ending position is not included). Write a function that searches for a word in a sentence, ignoring case, spaces and punctuation marks, and returns a list containing the beginning and ending positions. If the word is not found, the function returns an empty list.

Step by Step Solution

3.43 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Python program to check the string is present in subst... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!