Python Lists and Dictionaries - Access by Index


#1

This is not working and i cant go ahead someone HELP!!!!!!!!!

This is for Python Lists and Dictionaries Access by Index

numbers = [5, 1, 7, 3]

print "Adding the numbers at indices 0 and 2..."
print numbers[0] + numbers[2]
print "Adding the numbers at indices 1 and 3..."
print numbers[1] + numbers[3]

Help needed


#2

Please post a link to this exercise. Thanks.


#3

do not modify the numbers in list:

numbers = [5, 6, 7, 8]

@mtf, exercise url:

https://www.codecademy.com/en/courses/python-beginner-en-pwmb1/0/2


#4

@mtf
https://www.codecademy.com/courses/python-beginner-en-pwmb1/0/2?curriculum_id=4f89dab3d788890003000096
Im kinda new to this coding thing and im pretty sure ive done something wrong
thanks


#5

As @stetim94 pointed out, do not alter the provided list of numbers. Your code is fine.


#6

modifying the numbers in list will mean the sum of the numbers doesn't match with what the exercise expects


#7

@stetim94
@mtf
Thank you


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.