+ 3
What is index in Python?
Please answer that question
3 Antworten
+ 6
Index means position in python. For example:
âââââââââââ-
list = [âaâ, âbâ, âcâ, âdâ]
list.index(âcâ)
>>> 2
ââââââââââââ
Explanation: On which position is the letter b in the list? Answer: 2 (2nd position)
Attention: In Python, index starts from 0, not 1. So although b is the third element, the output is 2.
Hope this helps, morteza đ
+ 4
morteza , youâre welcome đ
+ 3
Thanksđđ