+ 1

Can someone explain why some methods, statements, special characters begin with 0 while other with 1?

Im just starting off and I noticed some special characters "list, index, len" begin with 0 while others start off with 1? What makes the 1 so different?

6th Apr 2018, 6:58 AM
Boring Troll
Boring Troll - avatar
1 Resposta
+ 5
You're question could refer to a number of things, but I will tell you two major tips regarding this. 1. When dealing with lists and dictionaries (and other arrays), 0 refers to the first item in the array, it is not 1. So grabbing the first item in a list would look something like this... myList[0] 2. If you wanted something like a random number between 1 and 50, you would use the 1 like so... range(1, 50) I hope this helps a little. :)
6th Apr 2018, 7:34 AM
synorax
synorax - avatar