Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialbehar
10,799 PointsPython basic .index?
I dont understand this challenge. How do i check to see if the first place in a string contains an a?
def loopy(items):
for things in items:
if things == ""
print(things)
1 Answer
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsYou can use the index value of the first character [0]
# example
for item in items:
if item[0] == "Y":
# do something
behar
10,799 Pointsbehar
10,799 PointsGot it, thank you so much!