Python Strings Types | Tutorials | Vskills

Python Strings types

Single Quotes

You can specify python strings using single quotes such as ‘Quote me on this’. All white space i.e. spaces and tabs are preserved as-is.

Double Quotes

Python Strings in double quotes work exactly the same way as strings in single quotes. An example is “What’s your name?”

Triple Quotes

You can specify multi-line strings using triple quotes – (“”” or ”’). You can use single quotes and double quotes freely within the triple quotes. An example is:

”’This is a multi-line string. This is the first line.
This is the second line.
“What’s your name?,” I asked.
He said “Bond, James Bond.”

Go back to Tutorial                                                                                Go to Home Page

Get industry recognized certification – Contact us