Answered step by step
Verified Expert Solution
Link Copied!

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 42 sensors on an ocean submersible. The 42 sensors are represented by 26 capital letters and 26 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 get_indices(sensor, stimulus) that takes two arguments and returns a list of integers. The first argument, sensor, contains a string that is a mix of uppercase/lowercase 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 range(len(lst)) or enumerate(lst)). PYTHON

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

Define compensation.

Answered: 1 week ago