Python: Difference between typing a tab and \t in triple quotes

python, python-2.7, quotes

Solution

Remember it is better to be explicit rather than implicit. Using the specific `\t` and `\n` leaves no room for assumption.

Problem

When writing a string in triple quotes """, what is the difference in literally putting in a \n or \t for new line or tab, and just writing it the way you want inside the quotes? Ex: ``` sample = """ I'm writing this On separate lines And tabs So why can't I write it like this /t instead of tabbing like this \n or new lining like this. Is one way preferred over the other? """ ``` Is one way preferred?

Original source