Computer Science, asked by atulvaibhav1234, 1 year ago

how are string literals represented and implemented in Python

Answers

Answered by writersparadise
169

String literals are represented in matching double quotes or single quotes. A second option is to use triple-quoted strings. These are matching groups of either three double quotes or three single quotes. The three double quotes option is usually used when you need a string that is more than one line long. Such string literals are called multiline string literals.

Answered by phillipinestest
67

In python, the literals named as 'string' are represented as either single quotes (') or in double quotes ("). It also represents three single or double quotes which are referred to as 'triple quoted strings' ('").

Usually while representing and implementing the strings' or 'single' or 'double quotes' is used to start and end the string.

A simple example for the implementation of the string in Python is given as "name".

Similar questions