[Tutor] creating and writing to a text file

Alan Gauld alan.gauld at yahoo.co.uk
Mon Mar 29 04:43:21 EDT 2021


On 29/03/2021 09:27, Phil wrote:
> On 29/3/21 7:20 pm, dn via Tutor wrote:
>> and just for laughs, use double-quotes to surround
>> the file-name.
> 
> I've never been sure when to use single or double quotes. Black confirms 
> that double quotes is the correct option in this case.

There is no difference between them and you can use
whichever suits in a particular case. But double quotes
are often less ambiguous than single especially when
doubling or tripling them.

The most likely cause of your error is that you hit
Ctrl-V and tried to delete it by hitting DEL. That
would insert a literal DEL into your string, which
would be invisible...

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list