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
Ostrovityanka [42]
3 years ago
15

Given the list of customer segments below please create a new list of the names of the segments only using(a) a for loop(b) a li

st comprehension(c) a map().List would look something like ['Wallstreet','Gambler','Parents'] but of course using each tool as listed:segments = [{'name': 'Wallstreet', 'average_spend': 82.01}, {'name': 'Gambler', 'average_spend': 107.00}, {'name': 'Parents', 'average_spend': 10.52}]
Computers and Technology
1 answer:
Alchen [17]3 years ago
7 0

Answer:

new_segment = [ ]

for segment in segments:

   new_segment.append({'name': segment, 'average_spend': money})

print( new_segment)

Using list comprehension:

new_segment =[{'name': segment, 'average_spend': money}  for segment in segments]

Using map():

def listing(a):

   contain =  {'name': segment, 'average_spend': money}

   return contain

new_segment = [ ]

new_segment.append(map( listing, segment))

print(list(new_segment)

Explanation:

The python codes above create a list of dictionaries in all instances using for loop, for loop in list comprehension and the map function which collect two arguments .

You might be interested in
The sum of all the minterms of a boolean function of n variables is equal to 1.
Aleksandr-060686 [28]

The answers are as follows:

a) F(A, B, C) = A'B'C' + A'B'C + A'BC' + A'BC + AB'C' + AB'C + ABC' + ABC

= A'(B'C' + B'C + BC' + BC) + A((B'C' + B'C + BC' + BC)

= (A' + A)(B'C' + B'C + BC' + BC) = B'C' + B'C + BC' + BC

= B'(C' + C) + B(C' + C) = B' + B = 1


b) F(x1, x2, x3, ..., xn) = ∑mi has 2n/2 minterms with x1 and 2n/2 minterms

with x'1, which can be factored and removed as in (a). The remaining 2n1

product terms will have 2n-1/2 minterms with x2 and 2n-1/2 minterms

with x'2, which and be factored to remove x2 and x'2, continue this

process until the last term is left and xn + x'n = 1

4 0
3 years ago
BitTorrent, a P2P protocol for file distribution, depends on a centralized resource allocation mechanism through which peers are
ch4aika [34]

Answer:

yes. it is true. mark as brainlest

8 0
2 years ago
Unlike memory, this type of storage holds data and programs even after electrical power to the computer system has been turned o
Scrat [10]

Answer:

Secondary memory.

Explanation:

Unlike main memory which loses its content when electrical power to the system is turned off, secondary memory is volatile and persistent in nature. i.e it retains its content whether or not power is supplied to the computer that is holding it. As a matter of fact, they (secondary memory) are meant to store data permanently. Examples of such memory are the hard drives, floppy disks, flash drives, CDs and CDROMs.

Also, unlike the primary or main memory that can be accessed directly by the processor of the computer housing it, secondary memory are not accessed directly.

8 0
3 years ago
Can someone help me so I don’t fail this class:(
charle [14.2K]

Answer:

Whatcha need help with?

Explanation:

4 0
3 years ago
A. True
svetlana [45]

Answer : True  

Explanation: Vectors can hold, data of the same type and can automatically expand accordingly and change it’s size. The date stored in vectors should be linear.  

- The syntax for vector is vector<int>v;

- Mostly this is used in C++ as an alternative to arrays  

- If you want to use vector in your program then define it in the header first  i.e.

#include <vector>

- Push back is a function, that is used to insert an element into the vector  

- Pop back removes the element from the vector  


6 0
3 years ago
Other questions:
  • PLEASE HELPP!! WILL MARK BRAINLIEST!!~~~~~
    11·1 answer
  • Which one of these tasks is part of the pre-production phase of game development?
    11·2 answers
  • Retrieve the names of employees who work on exactly one project that is controlled by their department. (It does not matter how
    7·1 answer
  • During which phase of film making does the team outline their vision for the film?
    5·1 answer
  • Which of the following prefixes would be best to use when measuring your own mass?
    15·1 answer
  • Audiovisual means that a presentation combines film and photos.<br> true or false?
    6·2 answers
  • The first commercially available digital camera was which of the following?
    9·1 answer
  • The first page of a website is what?​
    5·2 answers
  • When you save a presentation with a .potx file extension, which type of powerpoint file is created?
    8·1 answer
  • PLEASE HELP ME
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!