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
What is the faster way for browsers to obtain the revocation status of a digital certificate attached to a Web site?
Lyrx [107]

Answer:

The fastest way to obtain the revocation status of digital certificate of the website is by using Online certificate Status Protocol (OSCP).

Explanation:

Online certificate status protocol is the protocol that help user to check and verify the digital certificate revocation status. This protocol is linked with the digital certificate issuance authority. Whenever someone want to verify the status of the digital certificate that is attached to access the website. The website administrator can send the request to OSCP handler to ensure the status of the certificate. The OSCP handler is connected through certificate issuance authority, send the detail to verify the status. After verifying the status, OSCP handler respond as certificate is valid or revoked to the concerned user.

5 0
3 years ago
How important "saving" in every individual?​
photoshop1234 [79]

Answer:

The importance of saving money is simple: It allows you to enjoy greater security in your life. If you have cash set aside for emergencies, you have a fallback should something unexpected happen. And, if you have savings set aside for discretionary expenses, you may be able to take risks or try new things.

4 0
2 years ago
Write a Python function prime_generator that takes as argument positive integers s and e (where s
nika2105 [10]

Answer:

def prime_generator(s, e):

   for number in range(s, e+1):      

       if number > 1:

          for i in range(2, number):

              if (number % i) == 0:

                  break

          else:

               print(number)

   

prime_generator(6,17)

Explanation:

I believe you want to ask the prime numbers between s and e.

- Initialize a for loop that iterates from s to e

- Check if the number is greater than 1. If it is, go inside another for loop that iterates from 2 to that number. If the module of that number to any number in range (from 2 to that number) is equal to 0, this means the number is not a prime number. If the module is not equal to zero, then it is a prime number. Print the number

6 0
3 years ago
1. Assume that word is a variable of type String that has been assigned a value . Assume furthermore that this value always cont
s2008m [1.1K]

Answer:

1.word = "George slew the dragon"

startIndex = word.find('dr')

endIndex = startIndex + 4

drWord = word[startIndex:endIndex]

2. sentence = "Broccoli is delicious."

sentence_list = sentence.split(" ")

firstWord = sentence_list[0]

Explanation:

The above snippet is written in Python 3.

1. word is initialized to a sentence.

Then we find the the occurence of 'dr' in the sentence which is assign to startIndex

We then add 4 to the startIndex and assign it to endIndex. 4 is added because we need a length of 4

We then use string slicing method to create a substring from the startIndex to endIndex which is assigned to drWord.

2. A string is assigned to sentence. Then we split the sentence using sentence.split(" "). We split based on the spacing. The inbuilt function of split returns a list. The first element in the list is assigned to firstWord. List uses zero based index counting. So. firstWord = sentence_list[0] is use to get first element.

4 0
3 years ago
Explain the difference between file and folder (in your own words)
denpristay [2]

Answer:

the difference is one is online and one is not

Explanation:

A file is usually what you find online. And a folder is what you put papers into.

7 0
3 years ago
Other questions:
  • Suppose an array with six rows and eight columns is stored in row major order starting at address 20 (base 10). If each entry in
    8·1 answer
  • Justin signed a rental agreement for his new condo. How long is his lease? a p e x
    15·1 answer
  • Summarize why understanding the differences between surface culture and deep culture may inform your knowledge, skills, and prof
    14·1 answer
  • A national tax preparation firm is accessing industry-specific productivity applications in the cloud; many other tax preparatio
    13·1 answer
  • If you're searching for a date and a product at the same time, you're running a _______ query. A. Complex B. Select C. Parameter
    7·1 answer
  • Users at UC need to be able to quickly create a Resource record from the Project record's Chatter feed How should the App Builde
    10·1 answer
  • I need help with writing the code in Python that draws an arrow pointing to the right.
    15·1 answer
  • Write the following program in C++ to print:
    15·1 answer
  • the tool that is used on the form to display text that the user cannot change is a. textbox b. label c. button​
    9·1 answer
  • 25 Points Asap <br> Write a Java program named Light.java that displays a light bulb shown below:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!