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
Using the arrow key you can adjust the position of a selection in increments of
nadezda [96]

Answer:

Ok

Explanation:

8 0
3 years ago
You are searching for an item in an array of 40,000 unsorted items. The item is located at the last position. How many compariso
irina [24]
It depends on what algorithm you’re using.
If you’re going item by item, you’ll be looking at O(n) or O(40000)
Give me a reply if you want to know more, such as if you did binary search what the Big O notation is
4 0
2 years ago
* HELP FAST*Which Section do you need to go on in the Ribbon, to get to the button that will allow you Create a Link between tex
ankoles [38]

Answer:

Insert

Explanation:

Take with a pinch of salt cuz I'm not a coder or anything, but I've got a few skillz.

6 0
3 years ago
What are the 8 tips for<br>healthy living?​
disa [49]

Answer:

Base your meals on starchy foods.

Eat lots of fruit and vegetables.

Eat more fish.

Cut down on saturated fat and sugar.

Try to eat less salt- no more than 6g a day.

Get active and try to be a healthy weight.

Drink plenty of water

Explanation:

7 0
3 years ago
Read 2 more answers
In brainly.com which is best answerer​
mote1985 [20]

Explanation:

I don't know, because I had only spent one month in brainly. but I think it is Mister 360. s/he is a great answerer and always stay at top in leaderboard.

5 0
3 years ago
Other questions:
  • Blender questions
    8·2 answers
  • How do i cancel my brainly premium account?
    14·2 answers
  • How can you exaggerate the height of a jump in a photograph
    10·1 answer
  • Which is a circuit board located behind an LCD screen on a laptop?
    7·1 answer
  • When mapping a drive, you can type in the path to the shared folder on the host computer. what is the syntax for the path?
    7·1 answer
  • . Service recovery refers to A. the ability to quickly restore service following a service failure and provide compensation. B.
    5·1 answer
  • Which type of portfolio might a young investor who is not afraid of risk choose?
    12·1 answer
  • What type of version of visual studio is the visual studio express
    8·1 answer
  • Topic: Video Games.
    7·1 answer
  • Write the pseudocode for this flowchart
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!