+ 1

Why the use of a variable?

why bother with: max_index = len(words) - 1 when you can do away with the variable completely be altering the while condition to be'<' than not '<=' and comparing it to len(words). It's not like the list is changing each itteration. Or am I missing something?

20th Nov 2016, 6:43 PM
Tamonten
1 Answer
+ 1
well there's nothing stopping you from doing that is there? in some specific cases though yeah, you might need to do that. but it depends, and it's up to you to make it work how you want it.
20th Nov 2016, 6:47 PM
asdadasdsaczxc