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
Travka [436]
3 years ago
7

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:
hichkok12 [17]3 years ago
8 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
Smith, Smith, Smith, and Smith is a regional accounting firm that is building a new headquarters building. The building will hav
GuDViN [60]

Answer:

 During the network cable planning and designing the building it helps in reduce the various networking errors as, the various types of errors are mainly occur due to the transmission of the data. The errors in the network is also depend upon the particular type of the circuit.

The network errors can be minimized and reduce by detecting, preventing and also correcting the given errors. By using the cable shield and also preventing the cables from the noise and the power sources and also by improve the quality of the connection, media and the networking equipment in the given network.

4 0
3 years ago
Which type of device log contains the most beneficial security data?
zhuklara [117]
The security Log is your Answer.
6 0
3 years ago
what does it mean when the save button on the quick access toolbar changes to a circular set of two arrows?
elixir [45]

When the save button on the quick access toolbar changes to a circular set of two arrows, it means that workbook is saved in the cloud  (It means word is automatically syncing your changes back to OneDrive).

  • The Quick Access Toolbar (QAT) is simply known as small modifiable toolbar. It is often located at the top of the office application window that is, it can be seen next to the Microsoft Office button. It is known to have its own  set of independent commands and render quick access to commands like Save, Undo, Redo, etc.
  • OneDrive is a renown Microsoft cloud service and a type of cloud services that helps individuals to link up oneself to all our files. It allows storage and protection of  files, sharing and get to them any time.

Conclusively, we can say that When the save button on the quick access toolbar changes to a circular set of two arrows, it means that workbook is saved in the cloud  (It means word is automatically syncing your changes back to OneDrive).

Learn more from:

brainly.com/question/17163678

7 0
3 years ago
Help me I'm so confused by this question
EastWind [94]
When the box with the stripe is on top and your changing the colour of it
4 0
4 years ago
What is an example of an Internet access problem?
Alona [7]
D One type of web browser....
3 0
3 years ago
Read 2 more answers
Other questions:
  • Preserving confidentiality, integrity, and availability of data is a restatement of the concern over interruption, modification,
    15·1 answer
  • Which of the following statements is true?
    10·1 answer
  • What is one course of action available in every problem solving process?
    9·2 answers
  • How to delay sending an email in office 365
    6·1 answer
  • How come the scroll bar on the PA emojis only appears sometimes? how do I make it appear?
    12·1 answer
  • If you tap or click the increase font size button too many times and make the font size too big, you can tap or click the _____
    9·1 answer
  • Write a function to output an array of ints on a single line. Funtion Should take an array and an array length and return a void
    9·1 answer
  • What is one reason you might want to change your document's margins
    12·1 answer
  • Viết thuật toán và chương trình: Tính tổng:<br> S=1+2+...i
    8·1 answer
  • Is electricity a force or energy?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!