0

On the course

I notice in the beginning they use (' ') for Python 3. I've started with Python 3 and had many errors. But even in Python 3 as well as Python 2.6 it's typed (" "). Why the difference in the lesson??

27th Jan 2019, 6:48 PM
Glenn
Glenn - avatar
3 Answers
+ 3
The apostrophe ' and quotation mark " are eqivalent in Python, they both should work equally, as long as you use them consistently. Your errors must have another cause.
27th Jan 2019, 6:55 PM
Tibor Santa
Tibor Santa - avatar
+ 3
Python uses single quotes internally. print(repr(chr(85))) # 'U'
27th Jan 2019, 7:06 PM
Anna
Anna - avatar
+ 3
You can use them to output the other character: print ("This is an apostrophe: '") print ('This is a quotation mark: "')
27th Jan 2019, 9:41 PM
Sebastian Keßler
Sebastian Keßler - avatar