Python For Loops - Screen 6

When reading the following statement in the learn section:

“We start by opening the file using the open() function …”

I understand that after typing the mentioned code (screen shot attached), AppleStore.csv file will open automatically as I have download and saved it on my computer with the same name but that does not happen. Though I get the same output in code editor as in the learn section, where am I wrong here?

Not entirely sure of your situation, but make sure that you either define the code path to where the file exists in the open statement or, more simply, make sure that the file and the code document you’re working out of are in the same file folder.

The Dataquest web application is isolated from your computer drives. It has its own environment with all the files you need.

If you want to work with a file that’s outside this environment, you need to first upload it. You do the same thing when you work on Google Colab. Or you specify a link to Google drive to get your file.

Furthermore, even if you work on the Dataquest environment or with your own file, you will get the same output for your code.

After opening the file, you need to use the reader and list functions to view it.

1 Like

Hi @mursuljamil,

If you feel that  your question was successfully solved, could you please mark the helpful answer as Solution? You can find here how to do it technically (in the GUIDELINE #5). Please consider this practice also for any other questions you might ask in the Community. This would be of great help both to your helpers and the other learners who can have the same questions in the future.

Many thanks and happy learning! 

NOTE: This is an automated message.

1 Like