top of page
Subham Das

String


In python string is type(class) that is a sequence of character enclosed in double quotes(" "). It is immutable i.e. a string cannot be changed. A string is a data type used in programming, such as an integer and floating point unit, but is used to represent text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers. For example, the word "hamburger" and the phrase "I ate 3 hamburgers" are both strings. Even "12345" could be considered a string, if specified correctly. Typically, programmers must enclose strings in quotation marks for the data to recognized as a string and not a number or variable name.


Index operator in String


: , [ ]

The above two operator are prime operator for string indexing. String indexing is a process by which string members can be accessed by specifying the respective position of members by the index.This is specifying of index by positive integer.


Function of string in Python



14 views0 comments

Recent Posts

See All

Iterative Structure

If same type task is repeated by a structure till the condition is true, then it is called repetitive structure or loop. In Python two...

Comentários


logo12.PNG
bottom of page