Python String Literals


String Literals

String literals in python are surrounded by either single quotation marks, or double quotation marks.

'hello' is the same as "hello".

You can display a string literal with the print() function:

Example

print("Hello")
print('Hello')
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.