Answers for "python index a list"

43

python find index by value

>>> ["foo", "bar", "baz"].index("bar")
1
Posted by: Guest on November-19-2019
1

python lists

fruits = ['apple', 'banana', 'mango', 'cherry']

for fruit in fruits:
  print(fruit)
Posted by: Guest on June-29-2020

Python Answers by Framework

Browse Popular Code Answers by Language