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
Write the SQL statements that define the relational schema (tables)for this database. Assume that person_id, play_id, birth_year
Sunny_sXe [5.5K]

Answer:

  • SQL statement that defines table for Actor

CREATE TABLE Actor(

person_id integer primary key,

name varchar2(40) not null,

birth_year integer check ((birth_year) <= 2019)

);

  • SQL statement that defines table for Play

CREATE TABLE Play(

play_id integer primary key,

title varchar2(60) not null,

author varchar2(60) not null,

year_written integer check ((year_written) <= 2019)

);

  • SQL statement that defines table for Role

CREATE TABLE Role (

person_id integer,

character_name varchar2(60) not null,

play_id integer,

constraint fk_person foreign key (person_id) references actor(person_id),

constraint fk_play foreign key (play_id) references play(play_id),

primary key (person_id, character_name, play_id)

);

Explanation:

Other information that were not added to the question are as below:

The following database contains information about three tables i.e. actors, plays, and roles they performed.

Actor (person_id, name, birth_year)

Play (play_id, title, author, year_written)

Role (person_id, character_name, play_id)

Where: Actor is a table of actors, their names, and the year they were born. Each actor has a unique person_id, which is a key.

Play is a table of plays, giving the title, author, and year written for each play. Each play has a unique play_id, which is a key.

Role records which actors have performed which roles (characters) in which plays.

Attributes person_id and play_id are foreign keys to Actor and Play respectively.

All three attributes make up the key since it is possible for a single actor to play more than one character in the same play

Further Explanation:

In SQL, in order to define relational schema (Tables) for a database, we use CREATE TABLE statement to create a new table in a database.  The column parameters specify the names of the columns of the table.  The datatype parameter specifies the type of data the column can hold (varchar, integer, date)

4 0
3 years ago
To create a multiple-table form based on the âmanyâ table, tap or click the ____ button on the create tab to create a form in la
Archy [21]
Click on the blank form button. 
3 0
3 years ago
What is the primary responsibility of the physical layer in data communication?
melamori03 [73]
 It is responsible for transmitting these bits as signals over a wire, optical fiber, wireless, or other <span>medium.</span>
3 0
3 years ago
When a device or service causes the system to hang during a normal boot, boot into __________ and disable the device or service
Olenka [21]

You should boot into <u>safe mode</u> and disable the device or service when it causes the computer system to hang during a normal boot.

<h3>What is safe mood?</h3>

Safe mood can be defined as a boot option in which the operating system (OS) of a computer system starts in <u>diagnostic mode</u> rather than in a normal operating mode, so as to enable the user correct any problems preventing the computer system to have a normal boot.

This ultimately implies that, safe mood is a diagnostic mode of the operating system (OS) of a computer system that is designed and developed to fix most problems within an operating system (OS) and for the removal of rogue software applications.

Read more on safe mood here: brainly.com/question/13026618

5 0
2 years ago
Who is the three president of somalia​
Snezhnost [94]

Answer:

Siad Barre

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • The use of digital technology and the Internet to execute the major business processes in the enterprise is called
    11·1 answer
  • Which transformation(s) can be used to map ARST onto
    8·1 answer
  • Bill downloaded an antivirus software from the Internet. Under the Uniform Commercial Code (UCC), the software is a: Select one:
    15·1 answer
  • Select the statements that are true regarding the future of technology. Select 2 options.
    10·2 answers
  • What could be one rule to help your friend to blog safely
    6·2 answers
  • Explain the importance of determinism in an industrial LAN
    8·1 answer
  • Caleb is a big fan of science fiction, so he loves picturing the ________ gland as the captain of his personal starship, pulling
    9·1 answer
  • What term is used to refer to the merging of government services with information technology?
    11·1 answer
  • When was the Ethics Resource Center (ERC) established? In the 1970s In the 1980s In the 1990s In the 2000s
    14·1 answer
  • What is the function of the NOS? Select all that apply.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!