List items are indexed. You can access list element by index. First element index will be 0. The second element index will be 1, and so on.
Syntax
list_name[index]
The negative index allows you to access elements starting from the end of the list.
Note: Remember that the first item has index 0.
You can use range of indexes to get list elements.
You can use the negative indexes to get list elements.
Syntax
list_name[start:end]
You can leave the start index. In this case first element index will be use as the start.
Syntax
list_name[:end]
You can leave the end index. In this case last element index will be use as the end.
Membership operator(in, not in) is used to check element exist or not in the list.
Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.
Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.
comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.
comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.
copyright © 2023