I'm trying to rewrite this code using lists. Raise index crashes the program if I > 4. How can I make this code smaller using lists? Any help is appreciated.
if (I == 0):
J = -12
elif (I == 1):
J = 24
elif (I == 2):
J = -6
elif (I == 3):
J = 193
elif (I == 4):
J = 87
else:
raise IndexError