Get position in list

Solved
Hello,

I would like to know how to get the position of an element in a list with Python?

For example, if I have a list ['lundi', 'mardi', 'mercredi'], I would like to ask it: give me the position of mardi in the list (and logically, it should return 1).
How can I code this?

Thank you in advance.
Configuration: Windows XP Internet Explorer 6.0

5 answers

  1. liste = ['Monday','Tuesday','Wednesday']

    liste.index('Tuesday')
    >>> 1

    attention => causes an error if the element is not present in the list
    1. You're a handsome guy, brother.
    2. thanks, bro
    3. thanks a lot, good looking