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, 21.06.2019 19:30
The ph of carrots are 5.0 how it is classified a.acidic b.basic c.indicator d.neutral
Answers: 2
question
Chemistry, 22.06.2019 13:00
Tell me the iupac names of the following alcohols:
Answers: 2
question
Chemistry, 22.06.2019 14:30
Calculate the mass of carbon in 97.0 g of sucrose c12h22o11
Answers: 3
question
Chemistry, 22.06.2019 16:00
How do dying stars contribute to the formation of planets
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
Social Studies, 08.04.2020 02:53
question
Physics, 08.04.2020 02:53
question
Mathematics, 08.04.2020 02:53