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 22:20
Asolution is made by dissolving 25.5 grams of glucose (c6h12o6) in 398 grams of water. what is the freezing point depression of the solvent if the freezing point constant is -1.86 °c/m? show all of the work needed to solve this problem.
Answers: 1
question
Chemistry, 21.06.2019 23:00
Achef makes salad dressing by mixing oil, vinegar, and spices, as shown. which type of matter is the salad dressing?
Answers: 1
question
Chemistry, 22.06.2019 03:30
What is the number of moles of chemical units represented by 9.03x10^24? and how do i show work? (dumb it down )
Answers: 1
question
Chemistry, 22.06.2019 04:30
The big bang nucleosynthesis theory states that elements were produced in the first few minutes of the big bang while elements have their origins in the interiors of stars, forming much later in the history of the universe.
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
Questions on the website: 13722360