Lists
All right then, we are quite sure on how to use the servo and have a controlled motion as per our needs. Now it's time to move forward and understand another concept that we would be using greatly. It's named arrays. If you have programmed in any other language, you must be familiar with it. But we need to understand a few basics concepts of it, which will make our lives a lot easier. So, let's get started.
First things, first. Arrays in Python are not named arrays, rather it is named as lists. List is basically a data structure that can store multiple elements at the same time. The only limitation being is that the elements must be of the same data type. Such as if you are storing integers, then all the values should be int
. Similarly, if you are storing a character, then every element of the list should be char
. To define a list, all you need to do is name the list such as we have done by doing myList
; the name of the list could be anything next we need to tell the compiler that it...