[Tutor] Please Help

Mats Wichmann mats at wichmann.us
Sat Sep 7 15:25:58 EDT 2019


On 9/7/19 6:22 AM, Sean Frazier wrote:
> I am running a problem in 'Think Python' and was having no issues with:

[var = open('file.txt')]

> I have tried opening as 'r' and 'w', with no luck.
> 
> Also, sometimes I do not get an error, but when I go to read the list, it is empty ''.


what you have written is invalid - you are trying to do an assignment
inside a list specifier, Python's syntax doesn't allow that.

I'm guessing the brackets were just for emphasis for the email, but it
helps when asking questions if you're really precise!!!



More information about the Tutor mailing list