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
Galina-37 [17]
4 years ago
15

SUMMING THE TRIPLES OF THE EVEN INTEGERS FROM 2 THROUGH 10) Starting with a list containing 1 through 10, use filter, map and su

m to calculate the total of the triples of the even integers from 2 through 10. Reimplement your code with list comprehensions rather than filter and map.
Computers and Technology
1 answer:
Anestetic [448]4 years ago
7 0

Answer:

numbers=list(range(1,11)) #creating the list

even_numbers=list(filter(lambda x: x%2==0, numbers)) #filtering out the even numbers using filter()

triples=list(map(lambda x:x*3 ,even_numbers)) #calculating the triples of each even number using map

total_triples=sum(triples) #calculatting the sum

numbers=list(range(1,11)) #creating the list

even_numbers=[x for x in numbers if x%2==0] #filtering out the even numbers using list comprehension

triples=[x*3 for x in even_numbers] #calculating the triples of each even number using list comprehension

total_triples=sum(triples) #calculating the sum.

Explanation:

Go to the page where you are going to write the code, name the file as 1.py, and copy and paste the following code;

numbers=list(range(1,11)) #creating the list

even_numbers=list(filter(lambda x: x%2==0, numbers)) #filtering out the even numbers using filter()

triples=list(map(lambda x:x*3 ,even_numbers)) #calculating the triples of each even number using map

total_triples=sum(triples) #calculatting the sum

numbers=list(range(1,11)) #creating the list

even_numbers=[x for x in numbers if x%2==0] #filtering out the even numbers using list comprehension

triples=[x*3 for x in even_numbers] #calculating the triples of each even number using list comprehension

total_triples=sum(triples) #calculating the sum

You might be interested in
A _ shows the end of a page . ​
marta [7]

Answer:

page break shows the end of a page.

4 0
3 years ago
Read 2 more answers
HELP! Identify the parts of the table. <br>A) Primary Key<br>B) Field<br>C) Record<br>D) Table<br>​
joja [24]

The primary key is the block under the Movie ID column.

The Field is the Movie Name.

The Record is the block that goes with the first row of data.

The Table is the bottom block in the center.

4 0
4 years ago
Read 2 more answers
What type of culture is computer hardware?
skad [1K]
Culture, the software, is learned to trigger evolution to a new type of society, they may all.
6 0
3 years ago
Read 2 more answers
When it comes to collecting and organizing prospect and account​ information, salespeople have a large variety of computer syste
OleMash [197]

Answer:

sales force automation systems

Explanation:

Based on the information provided within the question it can be said that in this scenario these are known as sales force automation systems (SFA). This type of system or software is used in order to automate various business tasks, including managing contacts, order processing, sales, inventory, etc. Which is why it is mostly used by the salespeople.

4 0
3 years ago
Explain the working system of computer systems with examples​
geniusboy [140]

,I don't know you all about computer

8 0
3 years ago
Other questions:
  • Briefly explain what is net neutrality and why is it important today
    15·1 answer
  • Hey does anybody know how to delete history on a school-issued chrome book, I tried to delete it but it won't let you clear your
    7·1 answer
  • A user complains that his computer automatically reboots after a short period of time. Which of the following computer component
    13·1 answer
  • _____ is a systems development technique that produces a graphical representation of a concept or process that systems developer
    11·1 answer
  • Most computers and many mobile devices, such as smartphones and portable media players, can connect to which kind of network?
    11·1 answer
  • I am bad with excell pleasee heelp
    15·1 answer
  • Three common risk factors for young drivers and how you plan to minimize these factors.
    13·1 answer
  • Transborder data flow (TDF) restricts the type of data that can be captured and transmitted in foreign countries. True or False
    12·1 answer
  • Decimal numbers are based on __________.
    6·1 answer
  • What is closeable interface in java.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!