subject
Chemistry, 03.01.2020 22:31 cameronbeaugh

Couple implement the function couple, which takes in two lists and returns a list that contains lists with i-th elements of two sequences coupled together. you can assume the lengths of two sequences are the same. def couple(s1, s2): "return a list that contains lists with i-th elements of two sequences coupled together. > > > s1 = [1, 2, 3] > > > s2 = [4, 5, 6] > > > couple(s1, s2) [[1, 4], [2, 5], [3, 6]] » s3 = ['c', 6] > > > s4 = ['s', '1'] > > > couple(s3, s4) [['c', 's'], [6, '1']] assert len(sl) == len(s2) "*** your code here ***" use ok to test your code: python3 ok - couple q3: enumerate implement enumerate, which pairs the elements of a sequence with their indices, offset by a starting value. enumerate takes a sequence s and a starting value start. it returns a list of pairs, in whichthei-th element is i + start paired with the i-th element of s. for example: > > > enumerate(['maps', 21, 47], start=1) > > > [[1, 'maps'], [2, 21], [3, 47]] hint: consider using couple from question 2! hint 2: you may find the built in range function . def enumerate(s, start=0): "" "returns a list of lists, where the i-th list contains i+start and the i-th element of s. > > > enumerate([6, 1, 'a']) [[0, 6], [1, 1], [2, 'a']] > > > enumerate('five', 5) [[5, 'f'], [6, 'i'], [7, 'v'], [8, 'e']] "*** your code here ***"

ansver
Answers: 2

Another question on Chemistry

question
Chemistry, 22.06.2019 06:40
Ted and emily played a mixed doubles tennis match against jack and brenda. in the second match. ted and brenda played against jack and emily. which type of chemical reaction does the situation demonstrate?
Answers: 3
question
Chemistry, 22.06.2019 08:00
An observation that requires measurement is called quantitative observable or qualitative
Answers: 1
question
Chemistry, 23.06.2019 01:30
What are several ways to reduce the effect of friction
Answers: 2
question
Chemistry, 23.06.2019 09:00
The vapor pressure of water at 25.0°c is 23.8 torr. determine the mass of glucose (molar mass = 180 g/mol) needed to add to 500.0 g of water to change the vapor pressure to 22.8 torr.
Answers: 1
You know the right answer?
Couple implement the function couple, which takes in two lists and returns a list that contains list...
Questions
question
Mathematics, 05.11.2020 19:10
question
History, 05.11.2020 19:10
question
Chemistry, 05.11.2020 19:10
question
Mathematics, 05.11.2020 19:10
question
Mathematics, 05.11.2020 19:10
Questions on the website: 13722362