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
The spreadsheet below shows the age, grade level, major, and minor of four students in college. A purple background in the Major
LiRa [457]

Answer:

apply a filter by age with a value more than 20

Explanation:

First, we must create the spreadsheet with the fields student, age, grade level, major and minor.

For example:

If we want to create a filter, we must mark headings with the left click, then we must go to the tab Home --> at the section Editing, click in Sort & filter then Filter.

We must click in the field Age --> number filters --> greater than 20.

8 0
3 years ago
A hard drive that is running slowly may not have been
Anuta_ua [19.1K]
Plugged in i think is the answer
7 0
3 years ago
Read 2 more answers
Digital manufacturing has impacted our world today! List a reasons why.
Maru [420]
Because we can get manufacturing faster than usual
6 0
3 years ago
Your organization has started receiving phishing emails. You suspect that an attacker is attempting to find an employee workstat
EastWind [94]

Answer:

E). User education and training.

Explanation:

In the context of network security, the most significant aspect of ensuring security from workstation cyberattacks would be 'education, as well as, training of the users.' <u>If the employee users are educated well regarding the probable threats and attacks along with the necessary safety measures to be adopted and trained adequately to use the system appropriately so that the sensitive information cannot be leaked</u> while working on the workstation and no networks could be compromised. Thus, <u>option E</u> is the correct answer.

3 0
3 years ago
The Wired Equivalent Privacy standard had what significant disadvantage?
Ivanshal [37]

Answer:

Wired equivalent privacy standard has the significant disadvantages as, it is uses the static encryption keys. Wired equivalent privacy are the security and the privacy protocol which are used for designing the wireless local area network. And the static encryption key are used to set up the router for encrypting the packet in the device. The main disadvantage is that it enables the MAC address and it is easily detectable by the hackers.  

 

6 0
3 years ago
Read 2 more answers
Other questions:
  • USB keys can store terabytes of data. Of the five key factors that contribute to the increasing vulnerability of organizational
    13·1 answer
  • A ___ is the basic collective unit of data in a computer.
    12·1 answer
  • Which is an example of a screenshot?
    7·2 answers
  • What are scape codes and the effectes on out put
    6·1 answer
  • Please Help!! How to code this in Python?
    11·1 answer
  • Imagine that you have a friend who has expressed interest in designing and programming video games. He loves to play video games
    10·1 answer
  • What type of memory or storage device is prone to losing data if the power goes out?
    5·1 answer
  • Lee has changed the style of his table to make the header row stand out. Next, he wants to center the text in the header row and
    11·2 answers
  • Discuss five domains of Instructional technology​
    7·1 answer
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!