Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use PYTHON only. Thank you . def embedded_sounds (msg): We define a sound as a single vowel with a consonant on each side of

Please use PYTHON only. Thank you

image text in transcribed

. def embedded_sounds (msg): We define a sound as a single vowel with a consonant on each side of it (exactly three letters long, upper and lowercase all used). Given a message string or arbitrary length construct the list containing all embedded sounds from the message, in the order they appear. o Assume: msg is a string of any length. There are only five vowels: "aeiou". o Restrictions: no extra restrictions o embedded-sounds("HOTDOG") o embedded_sounds ("totoro") ["HOT","DOG"] ["tot","tor"] embedded-sounds("George Mason University") ["Mas", "son", "niv""ver","sit"] def nth_location(xs, n, v): Given a sequence of values xs, find the location where the value v occurs for the nth time and return that index. Return None when not found enough times o Assume: xs is a sequence of any length. n is a positive int. v is any python value o Restrictions; no extra restrictions o nth location([5,2,5,3,5,5,6,5], 3, 5) o nth location ("abracadabra", 4, "a") o nth location ([3,3,3,5,6,3,8], 20, 3) None # no 20th 3 to find .def largest_row(grid): Given a list of lists of numbers, named grid, find the row with the largest sum of its items, and return that sum. If there are no rows, return None. An empty row's sum is 0 o Assume: grid is a list of lists of numbers, e.g. [[1,2,3], [4,5,6]]. o Restrictions: remember, you can't call sum) or other functions to calculate the sum of a row. largest-row( [[10,10],[30],[1,1,1]]) largest_row(-1,-2],-5,-6]1) largest_row() largest_row L-5], [1,-6]1) 30 o o o None # empty []'s sun: e

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

Step: 3

blur-text-image

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions