Jan-19-2019, 06:11 PM
Hi,
I need to find all strings that have particular characters at a certain index and store those words in a list. Eg; I want to find all strings that have A at index 4. I have tried to do this, but I am very much a beginner and can't get it to work. This is what I have tried:
I need to find all strings that have particular characters at a certain index and store those words in a list. Eg; I want to find all strings that have A at index 4. I have tried to do this, but I am very much a beginner and can't get it to work. This is what I have tried:
Import random, string random = [whizzy, mizzly, scuzzy, buzzed, frizzy, fuzzed, huzzah, jujube, muzzle, puzzle, bazzed, buzzer, buzzes, luzzes, fezzed, fizzed, fizzle, fuzzes, guzzle, mezuza, mizzen, mizzle,pizzle] def found_words(word): segment = [] for char in word: if char[5] in char == 't'or 'o' or 'h': segment.append(char) return segment found_pairs(random)Thanks in advanced for any help :)