How to find the number of a list item

0 votes
Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index 1?
Sep 11, 2023 in Python by Satyawrat
• 460 points
394 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

How to find the index of an item in a list?

One thing that is really helpful in ...READ MORE

answered Dec 3, 2020 in Python by Gitika
• 65,770 points
1,532 views
0 votes
1 answer

How to count the number of elements in a list?

1) Count total number of numbers in ...READ MORE

answered Apr 14, 2021 in Python by VISHAKHA AGARWAL

edited Mar 5 5,429 views
0 votes
1 answer

How to find the greatest number in a list in Python?

Consider a list of numbers. Write a ...READ MORE

answered Apr 14, 2021 in Python by anonymous

edited Mar 5 2,966 views
+2 votes
2 answers

In a list of dictionaries, how can I find the minimum calue in a common dictionary field.

There are several options. Here is a ...READ MORE

answered Apr 10, 2018 in Python by charlie_brown
• 7,720 points
1,552 views
0 votes
1 answer

how to find factorial of a number?

You can find factorial by many ways. ...READ MORE

answered May 4, 2018 in Python by aayushi
• 750 points
1,785 views
–1 vote
2 answers

How to find the size of a string in Python?

following way to find length of string  x ...READ MORE

answered Mar 29, 2019 in Python by rajesh
• 1,270 points
2,417 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,647 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP