Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Similar to how character data is encoded as numbers in ASCII, scientific data can also be encoded as characters. You ve been given a list
Similar to how character data is encoded as numbers in ASCII, scientific data can also be encoded as characters. Youve been given a list of strings that represent sensors on an ocean submersible. The sensors are represented by capital letters and lowercase letters. By determining which sensors were triggered by a group of stimuli your organization hopes to hone in on the sources of chemical pollutants in the ocean. Write a function getindicessensor stimulus that takes two arguments and returns a list of integers. The first argument, sensor contains a string that is a mix of uppercaselowercase letters and spaces. The spaces represent gaps where none of the sensors were triggered. The second argument, stimulus, is a string of characters which could be uppercase or lowercase. These are the targets that your organization cares about. If any characters in the second argument stimulus appear in the first argument sensor your function should return the index where they appear in sensor If there are no matches or either argument is an empty string, it should return the empty list.
NOTE: this function IS case sensitive Your solution must use an index loop either with rangelenlst or enumeratelst
Example usage:
getindicesabtZZfg pQioeQr r r Yi 'aeiou'
getindicesabtZZfg pQioeQr r r Yi 'AEIOU'
getindices 'aetuh'
getindicesXAPPZXYxP
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started