We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e3177d commit a4dfcf4Copy full SHA for a4dfcf4
first_and_last_occurrence.py
@@ -0,0 +1,4 @@
1
+l = [ 1,2,3,4,3,2,6]
2
+
3
+print(min([i for i,val in enumerate(l) if val == 2]))
4
+print(max([i for i,val in enumerate(l) if val == 2]))
0 commit comments