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 trialAlex Ramirez
1,885 PointsPython Basics: Challenge Task 1 of 2: I am having trouble solving this challenge.
Am I in the right direction?
var1 = "abcdef"
var1.list('f')
1 Answer
markmneimneh
14,132 PointsHello
The question not clear as I am not taking same course.
here is something that may help. Please run this code
var1 = "abcdef"
a_list = list(var1)
for a_letter in var1:
print(a_letter)
for a_letter in a_list:
print("the index is {} and the value is {}".format(a_list.index(a_letter), a_letter))
and check the print out. this should guide you
if this answers your question, please mark the question as answered.
Tony Martin
5,570 PointsTony Martin
5,570 PointsAlmost! The key here is to remember that counting indexes start at 0!
So, looking at your string,
.... can you figure it out from there?