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
Why was unicode invented
GrogVix [38]
The old system, ASII, was no where near large enough to deal with all the different languages & symbols that exist  
5 0
3 years ago
Read 2 more answers
An indicator is a comprehensive analysis of critical information
ioda

Answer:

True.

Explanation:

An indicator is a comprehensive analysis of critical information by an adversary normally providing the whole picture of an agency's capabilities.

Hope this helps!

3 0
4 years ago
To use the styles in an external style sheet, you can drag and drop the style sheet file into the head section of the aspx file
Neporo4naja [7]

Answer:

False

Explanation:

Cascading style sheet (CSS) is a web development tools used to create web pages. They give style or determine how a HTML file is a parse in a web browser.

There are three ways of adding CSS to a HTML file. First is the inline css, in which the styles of an element in the HTML file is described in that element tag. The second is using the style element in the HTML file to create css for elements in the file.

The third is external CSS file. The CSS file is created and linked to the HTML file through the link element in the head tag.

4 0
3 years ago
All of the following are organization habits except:
atroni [7]
A. multitasking 
the rest of them are 

6 0
3 years ago
What is the differnce between concurrent software and sequential software and which one is better with multiprocessors ???
3241004551 [841]

Answer:

Concurrent software is better suited to parallel processing environment represented by multiprocessors as compared to sequential software.

Explanation:

Sequential software corresponds to a code which is executed step by step on  a single processing unit. A concurrent software on the other hand supports parallel execution by splitting the execution across multiple parallely executing component units. A multiprocessor system speeds up concurrent execution by providing independent execution units (processors) for these code segments running parallely. So concurrent software is better suited to multiprocessors.

4 0
3 years ago
Other questions:
  • Rather than manually setting a print area each time you want to print a range, you can ____ the range.
    13·1 answer
  • Wired Equivalent Privacy (WEP) is an IEEE 802.11 wireless protocol which provides security algorithms for data confidentiality d
    14·1 answer
  • Which of the following is an acronym? A.RAM B.Every Good Boy Does Fine. C.association D.mnemonic device
    13·1 answer
  • Arrange the following units of storage in descending<br> order. B, TB,KB, GB,MB
    5·1 answer
  • What does this mean in python?
    5·1 answer
  • g Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative inte
    12·1 answer
  • People who rely on others for financial support, such as children and the elderly, are referred to as 16 O A. recipients O B. be
    9·1 answer
  • What breakthrough in sound recording facilitated stereophonic recording? Ο Α. overdubbing O B. multitrack recording O C. digital
    10·1 answer
  • Draw and implement of an organization which have 125 employees. use the following features 1.email services 2.lan communication
    8·1 answer
  • Complete each sentence. To add a graphic to a Word document, start by clicking the tab. Next, click . Then, navigate to the grap
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!