I'm trying to write an array of 5 elements that are user inputted. If the element is divisible by 5, 10 should be added to the element. I have the basic code for the array:
p= [ 0 for i in range(5) ]
print ("Enter an integer number: ")
for i in range (5):
p[i]= int(input())
print ("The modified array is", p)
But I don't know how to modify (i)?
As far as I understand I have to use enumerate, but how s that applied to a input value?
for i,x in enumerate(p):
if x % 5 ==0 :
p[i] + 5
But this does not modify the array at all? What am I doing wrong?