Notes on Quotes

Python allows the user to enclose character strings in single, "double", ”’triple”’, and even """triple double""" quotes (the latter two can be used for multiline strings). However, when printing out strings, it always uses single quote notation, regardless of which quotes you used in the program.

Many other languages (C, C++, Java) use single and double quotes differently: single for individual characters, double for character strings. To pay tribute to this differentiation, in this book I, too, use single quotes for single characters and double quotes for character strings.

Get Data Science Essentials in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.