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
I have this questions i need to make it in a report format pages of atleast 3 pages and maximum of 5 pages​
Nuetrik [128]

First write what is software take one page for that

and each page for all other topics

6 0
2 years ago
What Word features allow you to copy multiple paragraph formatting syles
PSYCHO15rus [73]
Format painter allows us to copy multiple fomatting styles at the same time from within a word document
5 0
3 years ago
What options are available for storing backups, physically?
RUDIKE [14]

The options are available for storing backups, physically are:

  • In both on site and off site,, a person can backup data to a given system that is located on-site, or the backups can be sent to any  remote system that is off-site.

<h3>What is a backup?</h3>

This is known to be a device that helps to save information or data temporarily or permanently.

Note that in the above, The options are available for storing backups, physically are:

  • In both on site and off site,, a person can backup data to a given system that is located on-site, or the backups can be sent to any  remote system that is off-site.

Learn more about backups from

brainly.com/question/17355457

#SPJ12

7 0
1 year ago
What is the effect of this line of CSS code?
Semenov [28]
The correct answer is C
6 0
2 years ago
The Beaufort Wind Scale is used to characterize the strength of winds. The scale uses integer values and goes from a force of 0,
joja [24]

Answer:

The equivalent if statements is:

ranforce = randi([0, 12]);

if (ranforce == 0)

     disp('There is no wind')

else  if(ranforce>0 && ranforce <7)

     disp('There is a breeze')

else  if(ranforce>6 && ranforce <10)

     disp('This is a gale')

else  if(ranforce>9 && ranforce <12)

     disp('It is a storm')

else  if(ranforce==12)

     disp('Hello, Hurricane!')

end

Explanation:

<em>The solution is straight forward.</em>

<em>All you need to do is to replace the case statements with corresponding if or else if statements as shown in the answer section</em>

4 0
2 years ago
Other questions:
  • You know a Linux command will perform a desired function for you, but you cannot remember the full name of the command. You do r
    14·1 answer
  • CAD helps professionals to _____. create a technical drawing give directions to a new location calculate the interest rate of a
    13·2 answers
  • MTTF is a file format developed by Microsoft commonly used on Windows systems; it offers file security, large volume size, large
    11·1 answer
  • If you were to mount a nonmetallic box to the front of a stud, what type of bracket should the box have? A. FP B. BP C. NP D. JP
    13·1 answer
  • Text can be easily moved from one location to another using _____.
    15·1 answer
  • What is trouble shoot​
    11·1 answer
  • Why are computers complicated?
    15·1 answer
  • 4.12 LAB: Using math methods Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to
    10·1 answer
  • Why do we need operating systems?
    7·1 answer
  • Kaitlin likes a particular design theme, but she is not sure about every single color for bullets, backgrounds, etc. found in th
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!