Understanding of "STRING" in python.

·

1 min read

This is the sequential category data type:

1.what is string?

A) String is one of the predefined class and treated a sequence data type.

String is a collection of charcters or Alpha numeric data or numeric data or any type of data enclosed with single quotes,double quotes,tripple double quotes, tripple single quotes.

2.notations of string?

A)we have 4 notations that are

1.single quotes

2.double quotes

3.tripple double quotes

4.tripple single quotes

3.Types of String?

A) we have two Types of strings

1.single line string data

2.multi line string data

Single-line string data:

Syntax: varname = "single line string data"

or

varname='single line string data'

with the help double quotes(" ") and single quotes(' ') to store single line string data only but not possible multi line data.

Multiline line data:

Synax1 : varname = " " " string data 1

string data 2

string data -n " " "

or

Synax 2 : varname = ' ' ' string data 1

string data 2

string data -n ' ' '

with the help tripple Double quotes(" " " " " " ) and tripple single quotes(' ' ' ' ' ') to store single line string data only but not possible multi line data.