I want to create a list in python which will be having a variable and its location say a list of 10 values location from 0 to 9 eg at location 0 'Abc', 1 'Cde', 2 'Fgh',.... and so on now I want to use the list values in loop incremented by one
list=['Abc','def','ghi'] # Or this may be an excel file with index and one column having different values
i=0 #has list value 'Abc'
while i<=3:
a=i
print('List value at'+i+' equals to',List[i])
i=i+1
Input data frame
select List value at index 0 and assign it to an object and then increment index till all the list values.
Output Required
'List value at 0 equals to Abc'
'List value at 1 equals to def'
'List value at 2 equals to ghi'
'List value at 3 equals to jkl'
'List value at 4 equals to mno'


while i<=3will result in an exception because your list has only three elements (remember: python lists are zero based) 2. You havelistandList3. Why thisa=i? 4. You have the indentation wrong ati=i+1