Question: 1 . We will use loops and a special kind of list called an array ( created via NumPy ) . More on this next

1. We will use loops and a special kind of list called an array (created via NumPy). More on this next class. However, what's critical to know is the difference between an index and a value. We will use both for loops and while loops and the print function to explore this concept.
a.(2 Points) Create a list variable and fill it with these numbers: 100,10,5,1,4
b.(1 Points) Create an integer variable named index and set the value to 2
c.(2 Points) Using the print() function print out the following statement: "The value of the list when the index is equal to two is: XX". Use the list variables and index variables you created in the previous two steps to fill in the XX.
d. Use a the print() function to say, "Entering for loop..." and then use a for loop to print out both the index and value of the function. Do not just print out the numbers. You need to print out he following statement inside the loop. "Index = XX; Value = XX". Make sure the spaces are in there and that these are on the same line. At the end of the for loop use the print() function to print "Finished with for loop... **hint use "for i in range(0,len()):"
I JUST NEED HELP WITH d! I listed the whole question for context!

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 Programming Questions!