3. Implement q3(inputString, minLetter, lettersTolgnore, specialLetter) so that it returns three things: the smallest letter in inputString that is both greater than minLetter and not in lettersTolgnore, or None if no such letter exists the highest index at which that smallest letter occurs, or None if such a letter does not exist True if specialLetter occurs an odd number of times in inputString, False

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 12E: (Program) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question

Python Help me please

3. Implement q3(inputString, minLetter, lettersTolIgnore, specialLetter) so that
it returns three things:
the smallest letter in inputString that is both greater than minLetter and
not in lettersTolgnore, or None if no such letter exists
the highest index at which that smallest letter occurs, or None if such a
letter does not exist
True if specialLetter occurs an odd number of times in inputString, False
otherwise
inputString is a string a zero or more lower case letters, minLetter is a lower
case letter, lettersTolgnore is a string of zero or more lower case letters, and
special letter is a lower case letter NOT in lettersTolgnore. Use a simple while
loop. You may not use any string methods (such as .count()), but you may use
the 'in' or 'not in' operators.
E.g.
>>> q3("bссacbd", "a", "eb", "z")
('c', 4, False)
>>> q3 ("bccacbd", "a", "aefg", "d")
('b', 5, True)
>>> q3 ("abc", "d",
(None, None, True)
>>> q3 ("aaabac", "d", "", "a")
(None, None, False)
",
"a")
Remember, as in HW1, to return three values, simply list them in the return
statement with a comma separating each. E.g. return (smallestLetter,
indexOfSmallestLetter, speciallsOddlyThere) or return smallestLetter,
indexOfSmallestLetter, specialIsOddlyThere
Transcribed Image Text:3. Implement q3(inputString, minLetter, lettersTolIgnore, specialLetter) so that it returns three things: the smallest letter in inputString that is both greater than minLetter and not in lettersTolgnore, or None if no such letter exists the highest index at which that smallest letter occurs, or None if such a letter does not exist True if specialLetter occurs an odd number of times in inputString, False otherwise inputString is a string a zero or more lower case letters, minLetter is a lower case letter, lettersTolgnore is a string of zero or more lower case letters, and special letter is a lower case letter NOT in lettersTolgnore. Use a simple while loop. You may not use any string methods (such as .count()), but you may use the 'in' or 'not in' operators. E.g. >>> q3("bссacbd", "a", "eb", "z") ('c', 4, False) >>> q3 ("bccacbd", "a", "aefg", "d") ('b', 5, True) >>> q3 ("abc", "d", (None, None, True) >>> q3 ("aaabac", "d", "", "a") (None, None, False) ", "a") Remember, as in HW1, to return three values, simply list them in the return statement with a comma separating each. E.g. return (smallestLetter, indexOfSmallestLetter, speciallsOddlyThere) or return smallestLetter, indexOfSmallestLetter, specialIsOddlyThere
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning