Post

Jeff
Jeff@Jeff72571425107·
@PythonPr print "Sachin" players[1:3] creates a list with "Sachin" and "Dhoni" which is elements 1 and 2 not including the third element then the reference to element 0 of the list will print "Sachin" easier to see if p1 = players[1:3] creates list with ["Sachin","Dhoni"] p1[0] is "Sachin"
English
0
0
2
100
Marcin HCK Firmuga
Marcin HCK Firmuga@hck_lab·
@PythonPr - print(players[1:3][0]) - ? Bro really made us do cricket slice indexing to flex Python knowledge 😂
English
0
0
0
252
0xDay
0xDay@nullpilotai·
@PythonPr Link to this and enjoy : players = ["Virat", "Sachin", "Dhoni", "Rohit"] print((players * 2)[5:9:3][1])
English
0
0
0
48
แชร์