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
lesya [120]
3 years ago
15

Write a new version (called map2) of the map function which operates on two lists. Your function should accept three parameters,

a function f and two lists X and Y , and return a new list composed of the function f applied to corresponding elements of X and Y . For concreteness, place the function first among the parameters, so that a call to the function appears as (map2 f X Y). Your function may assume that the two lists have the same length. In particular, given two lists (x1 x2 . . . xn ) and ( y1 y2 . . . yn ) (and the function f ), map2 should return
Computers and Technology
1 answer:
storchak [24]3 years ago
7 0

Answer:

def mapper( a, b ):

   return dict(zip(a,b))

def map2 ( f, x : list, y: list ) ->dictionary:

   mapped_lists = f( x, y )

   new_list = [ ]

   for key, value in mapped_lists.iteritems():

       items = [key,value]

       new_list.append(items)

   return new_list

result = map2( mapper, x, y )

print( result )

Explanation:

The "map2" python function defined above maps two lists of the same length. It receives two iterators or lists and a function and returns a list of mapped items from both lists.

You might be interested in
How do you think your ability to work might be affected if you don’t magnify a document so that text is at a size for you to rea
max2010maxim [7]

Answer:

It will have a negative effect on the quality of your work for sure.

Without being able to properly and easily read the text, you will not be able to distinguish between symbols that are similar... like "," vs "." or ';' vs ":" or "m" vs "n" or "I" vs "i", and so on.

You might not be able to see where a sentence stops and you'll keep reading, mixing up sentences and wonder why this is in the same sentence.

If you're dealing with a language with accents (like French or Spanish for example), you will not be able to distinguish the accents ("ê" vs "ë" for example).

5 0
4 years ago
What kind of heat we feel from the sun
ivolga24 [154]

Is it solar heat? ultraviolet heat? UV?
6 0
4 years ago
Read 2 more answers
Which type of server and network topology is preferable in a bank?
Mariana [72]

Answer:

1. Database

2. Tree

<u>Database</u>

An organized collection of data, that is stored form different computer system is called Database.

<u>Tree Topology</u>

A type of network in which multiple computers are connected in a tree like structure. This type of network topology is used to organize data in database.

<u>Explanation</u>

In banks database servers are used to organize and store large volumes of financial data.

<em>To organize such type of data with the help increasing number of employs on database, tree topology is used to connect all computers of that bank on the network,</em>

3 0
4 years ago
What is the basic computer application?​
Lena [83]

Answer:

a computer code

Explanation:

fhfdgkykd

8 0
3 years ago
What did major networks do to combat audience erosion in the 1990s?
S_A_V [24]

Answer: I think is 3. They acquired cable channels. They acquired cable operators.

Explanation:

6 0
4 years ago
Other questions:
  • Whereas lines of competition are clearly defined in the more established industries, in the Internet industry they are blurred a
    9·1 answer
  • Why are large commercial companies interested in developing mobile apps for smartphones?
    5·1 answer
  • The Campus Housing Service helps students find apartments. Owners of apartments fill in information forms about the rental units
    14·1 answer
  • Attetion developers i have a question can u devlop a website
    6·2 answers
  • Which of the following is true of lossy and lossless compression algorithms?
    6·1 answer
  • Words or symbols that help you narrow down your search are called:
    12·1 answer
  • Python - Write a program to print the multiplication table as shown in the image by using for loops.
    12·1 answer
  • Select the correct answer.
    10·1 answer
  • What is string literal in Java?
    5·1 answer
  • How can you make your MakeCode micro:bit program display either the letter<br> A or the letter B?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!