1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anna71 [15]
3 years ago
8

5. Write a function that takes two lists of integers and returns a list containing tuples with corresponding elements from both

the lists. For example - f ([1, 2, 3], [4, 5, 6]) -> [(1, 4), (1,5), (1,6), (2, 4), (2, 5), (2, 6), (3, 4), (3 ,5), (3, 6)]. If either list is null, the result is null. The lists do not have to be the same length.
Computers and Technology
1 answer:
Allisa [31]3 years ago
7 0

Answer:

def corresponding_of_lists(lst1, lst2):

   c = ""

   corresponding_list = []

   if (lst1 is None) or (lst2 is None):

       return None

   else:

       for i in lst1:

           for j in lst2:

               c = "(" + str(i) + "," + str(j) + ")"

               corresponding_list.append(c)

   return corresponding_list

Explanation:

- Create a function called corresponding_of_lists that takes two lists as parameter

- Initialize an empty list to hold the corresponding values

- Check if any of the lists are null, if they are return None

- Otherwise, get the corresponding elements and put them into the corresponding_list

Return the corresponding_list

You might be interested in
C2.5 - A group of four pirates has a treasure chest and one unique lock and key for each pirate. Using hardware that is probably
slavikrds [6]

Answer:

Explanation:

All the pirates uses their individual key and lock for the locking down of each the four sides of the lid of to the chest. Among the pirates, if three of them decides to open their latches, they can be able to lift the top by essentially using the fourth (locked) latch as a hinge to open the top. (We have several solutions or ways to do this.)

3 0
3 years ago
Why might a peer-to-peer network not be the best choice for a large corporate office setting?
omeli [17]

Answer:

a it is less private

Explanation:

8 0
3 years ago
How do I write this code in java? input "Enter Your Age to Order a Beer"
Klio2033 [76]

Answer:

i dont know sorry but answer above lol

Explanation:

5 0
3 years ago
Select the correct answer.
zmey [24]

the answer should be the letter a

3 0
3 years ago
Read 2 more answers
why is it useful to learn how to solve and program solutions with a limited set of command in computer science
12345 [234]

Answer:

Give at least one reason why it's useful to learn how to solve and program solutions with a limited set of commands. So that when there is more commands we know how to use the ones we have. parameters help generalize the solution to a specific problem. how are functions with parameters an example of abstraction?

4 0
2 years ago
Other questions:
  • A(n) ________ address is a temporary ip address assigned from an available pool of ip addresses.
    12·1 answer
  • Which of the following was one of the first internet search engines? A. archie B. google C. Yahoo D.ask
    7·1 answer
  • When performing conflict management, it is important to identify your;
    6·1 answer
  • Which director has shot a movie in HD? George Lucas, Michael Mann, Michael Moore, none of the above, all of the above
    14·1 answer
  • What was the effect of the norman conquest on the language of britain?
    11·1 answer
  • The type of e-cards that have an antenna built into them are __________ cards.
    10·2 answers
  • If a salesperson were trying to sell this cabin, which word would be best to use to make its size seem most positive?
    7·2 answers
  • Computer science practical on VB.NET. program 1. program to find the square of a number. write the code achieve it​
    6·1 answer
  • You send a friend a private message about something personal that is going on with you. Without permission, she forwards your te
    10·1 answer
  • 11. Explain different types of program control with suitable flow chart.<br> N
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!