If I enter 1234, it Valuescontains a string "1234".
Then you pass the string to an integer
ValueList=int(Values) # converts string "1234" to integer 1234
And add an integer to the empty list
List.append(ValueList)
Thus, your list contains only one item.
Therefore List[1]out of range
btw: , list.
. .
Edit
, - .
x - < 7 .
x=7
List=[]
for i in range(0,x):
verify=False
while verify==False:
Values=input("Enter Code")
verify=Values.isdigit()
ValueList=int(Values)
List.append(ValueList)
value1=int(List[0])
value2=int(List[1])
value3=int(List[2])
value4=int(List[3])
value5=int(List[4])
value6=int(List[5])
value7=int(List[6])
value8p1=(value1*1)+(value2*3)+(value3*1)+(value4*3)+(value5*1)+(value6*3)+(value7*1)
value9=math.ceil(value8p1//10)
print(value9)
, , :
x = 4
values = []
for i in range(0, x):
verify = False
while verify == False:
value = input("Enter Code")
verify = value.isdigit()
values.append(int(value))
result = 0
for index, value in enumerate(values):
if index % 2 == 0:
result += value * 3
else:
result += value
finalResult = math.ceil(result // 10)
print(finalResult)