Index starts at position 0 | Python

Опубликовано: 15 Март 2025
на канале: CyberTodd
592
19

To access items inside a list, you have to target the items by index. First, choose the name of the list, followed by the index that is encapsulated in square brackets. Remember that the first element starts at 0. Example:

a = ['Hi', 2, 'times', '.']
print(a[0])

Output:
Hi

-------------------------Subscribe----------------------------
• If you like to see a variety of fun and interactive projects written in Python
• If you love ☕ and 🐶 WAIT! - Yeah! Definitely, coffee and dogs!
-----------------------------------------------------------------------

-------------------------Socials----------------------------
• Twitter:   / iftodd1  
• Facebook:   / iftodd  
• Instagram:   / if_todd  
------------------------------------------------------------------

-------------------------Support----------------------------
You can support me here:   / if_todd  
--------------------------------------------------------------------

Index starts at position 0 | Python #shorts #python #lists