Post

Python Developer
Python Developer@Python_Dv·
🤔🚀 Comment your answers below! 👇
Python Developer tweet media
English
29
8
100
9.8K
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@Python_Dv Output: [2, 3] Why: -3 starts at index 1 (2), -1 stops before the last element (4). So the slice includes elements at indices 1 and 2 → [2, 3].
English
0
1
3
993
Jay
Jay@learnaiwthme·
@Python_Dv Answer: A → [2, 3] -3 starts at value 2. -1 stops before last element. So Python returns only the middle slice.
English
0
0
3
506
Jenny
Jenny@JennyTheDev·
@Python_Dv A) [2, 3] Negative indexing is like counting how many weeks until due date. Start from the end, don't include the last one 😅
English
0
0
2
576
ANKIT 𓃱
ANKIT 𓃱@A9kitSingh·
@Python_Dv Answer is A) [2, 3] -3 starts at 2, -1 stops before the last element. So it returns elements at index 1 and 2 → [2, 3]
English
0
0
2
315
Kunj Shah
Kunj Shah@gopal_kunj·
@Python_Dv [2, 3] because the 2 element of slice is exclusive.
English
0
0
1
287
Juan Pablo Abraham
Juan Pablo Abraham@Juan476·
@Python_Dv b) -3 you need to count in reverse order so you start in 3, Finally you finish in -1 is the last number of the list.(5) In python the last number not count
English
0
0
0
192
Paylaş