+ 2

using of quotes in python

I have 3 questions: 1. Can we use ''' instead of """ in Docstring 2. Can we use ''' while using string literals or string datatype 3. Can we use " and ' while making multi-line comments. I have tried and it all works but is there any rule which need to be strictly followed among developers.

10th May 2019, 3:56 PM
harshit
harshit - avatar
1 Resposta
+ 2
I don't like triple quote strings and therefore also would use normal quotes and split it up in lines using auto-concat for doc strings as it seems to work properly. So like this: 'Function f...' '... does this and that.' I wouldn't use strings for normal comments outside of doc strings because it is a real value (str) and will have to be parsed.
10th May 2019, 4:26 PM
HonFu
HonFu - avatar