Language Syntax

String literal — Python syntax

Construct Unicode str values from source text. Adjacent compatible literals concatenate at compile time; ordinary escapes are interpreted unless the literal is raw.

Formal Syntax & Structure

python syntaxpython
'text' | "text"

Return Value

str

Value obtained by evaluating this expression; see description for context and constraints.

Working Example

Example Snippetpython
text='سلام' ' Python'print((text,len(text)))
Python Reference