Hacking the Fender exercise uses loop concept not taught yet, help!

Hi, I am doing the Hacking the Fender exercise (https://www.codecademy.com/courses/learn-python-3/projects/hacking-the-fender) is the project for the Files section of Intro to Python. It is asking us to create a for loop to iterate through the CSV, but for the life of me I do not remember the course teaching us how to do this. I also searched back through the course contents and cannot find a mention of loops.

Am I missing something or is this a bug in the material? Or am I going crazy? Can someone point me to the place where the content teaches you how to do a loop? I am quite confused so really appreciate your help.

What course/path is this? Your link points to Learn Python 3 where the section on files is definitely taught after loops, syllabus link-
If it’s a different course then check the syllabus page of that particular course/path to see if it’s an upcoming section or something similar (you could use the one above for Py3 though the content may not be identical to a different course). I think it’s probably best to cover the looping material before files as you’d likely struggle without that knowledge.

1 Like

Fascinating. I don’t remember where I got that link, but the course is Analyze Data with Python

I went back and unearthed a tiny bit on looping, although I wish it had been covered in more depth. Maybe I should be doing the Learn Python 3 course instead.

This same Hacking the Fender exercise asks us to “Create a Python dictionary object within your with statement that relays a boss message,” and I know that this was not taught. I watched the video solution to figure it out but I don’t really feel like I am learning it, just copying what the solution was. Was this an oversight?

Hmm I couldn’t say for certain. The catalog seems to suggest this course is for beginners but skipping loops entirely seems like an issue. Lambda functions and list comprehensions being included but no loops suggests a slightly more advanced course.

for loops are discussed in the “iterating through lines” portion of this lesson.

with open('how_many_lines.txt') as lines_doc:
  for line in lines_doc.readlines():

Recommend place everything on hold until you complete the Learn Python 3 track.

1 Like