hi, having trouble getting my double list to output in question 5.
So far i have, doubleList = [] above my for loop and i get the correct number of list elements, but not the correct numbers are outputting. any hints?
I recommend checking the latest PowerPoint that Dr. Stonedahl posted on Moodle about how to modify the index inside of the list.
You can use the for loop to go through each index of the list and multiply it by 2. The indexes in that list will be changed without creating any variable.
for loop
Making a new list does not work here- the problrm asks you to modify the existing list. You can access the individual pieces of a list with []. You will need to set up a loop to modify each item.
after the for loop, have original list equals the new list. Something like this, aList[0:] = doubleList
Use for loop and slicing to refer to each number in the list. Next, write a line multiplying by the number to multiplied. Make sure you redefine the position in the list itself.