Question: Hello! I really struggle with my comp sci class and need assistance with this assignment. So far, I have: numbers = [42, 23, 66, 39,

Hello! I really struggle with my comp sci class and need assistance with this assignment.

Hello! I really struggle with my comp sci class and need assistancewith this assignment. So far, I have: numbers = [42, 23, 66,

So far, I have:

numbers = [42, 23, 66, 39, 87, 28] print('The length of the list is ', len(numbers))

index = 0

for index in range(len(numbers)): index += 1 print(numbers)

In your program, define a list and initialize it with the following numbers: 42, 23, 66, 39, 87,28 Then, execute the following tasks: (1) get the length of the list using the len function, and print its length. (2) use the for loop to iterate over each element by their index. Print out all elements together with their indexes. (3) [extra credit 25 Pts] In each iteration of the for loop above, determine if the individual element is an even number, and add the notation "even number" when printing out even numbers. (3) [extra credit 25 Pts] Count the total number of even numbers contained in this list within the same for loop. Print out the total amount by the end of program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!