Mar-12-2017, 09:07 AM
@scaperen, you are right.
Your error message is strange
Anyway! I use print(var1, var2, etc.) only for testing. Why I've used str.format() in my example? Because when one does the things in one way he/she create a habit. I've seen it in myself.
print('Item no. ', (i+1), ' is: ', listA[i])
works if the list is created without the 'start' and 'step' parameters because the loop gets the value. So the list has 21 elements and after the 5th iteration, the next value is 25 and if we use it as an index... well, it prints index out of range error. Your error message is strange
Anyway! I use print(var1, var2, etc.) only for testing. Why I've used str.format() in my example? Because when one does the things in one way he/she create a habit. I've seen it in myself.