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
What are the two ways to print a document?
guajiro [1.7K]

Answer:

ctrl+p or find the print button on the page

5 0
3 years ago
Which of the following may businesses use to screen out applicants for a position? A. social media B. applications C. resumes D.
Nataly_w [17]
The correct answer is E
8 0
3 years ago
Read 2 more answers
Please answer the following will mark brainiest except the first 3 rest all
ollegr [7]

Answer:

1) Standalone machine

2) Local

3) Either Wide area network(WAN) or a web

Done your first 3

6 0
3 years ago
In which utility is the file search option found in windows
OLEGan [10]

Press Windows logo key + X Key.

Click on Control Panel.

Double Click on Troubleshooting.

Click on View all option, on left hand side of the window.

Click on Search and indexing and follow the on screen instructions.

5 0
3 years ago
PLEASE HELP
gayaneshka [121]
Girl this happened to me too but all I did was try to look up info on things or examples to know how to do the work and stuff
7 0
3 years ago
Read 2 more answers
Other questions:
  • While in slide show mode, if you are not careful you can close the application by clicking the x on the menu bar. question 38 op
    12·2 answers
  • Why it’s important to keep the standard internet protocol TCP/IP?
    11·1 answer
  • Is a process in which an attacker attempts to acquire information about your network and system by social means, such as talking
    9·1 answer
  • Which term means a device that converts one voltage to another?
    13·1 answer
  • Write the proghrams for the following:
    13·1 answer
  • A normal HDMI signal has a colour depth of 8 bits per each of RGB colour. The maximum number
    13·1 answer
  • Adding Web pages helps Web designers ___. Choose all answers that are correct.
    13·1 answer
  • What is tnylnk? I keep seeing people leave answers with this.....can someone explain what this is, please...I might give brainie
    6·2 answers
  • PLZ HELP ASAP
    13·1 answer
  • Determining Correct Date Function What function text would you use to put today's date and time in a cell? 0 =TODAYO =NOWO O NOW
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!