What is Python String ?
Python is exponentially growing and is very much popular among data scientists and ml engineers. Python is an object oriented programming language and is a scripting language like php. It is used normally in web development as a server side language. And used in data science and machine intelligence for data analytics, preprocessing, model development etc. This article discusses python’s data type string.
A variable is a container that holds a value of a particular data type. In python, unlike Java the variables are not pre defined with its data type. It gets initialized with the value and its data type can later be known with type(). String being an alpha numeric data type can hold most of the data supplied to it.
Indexing in python allows access to characters at particular locations in the python string. The indexing begins from to the total length of the string -1. The indexing is always done with integers and no other data types instead. Any other data types can cause type error. Indexing makes string manipulation in python easier.
Printing strings with single and double quotes is not allowed as they are already defined in that similar fashion. Escape character backslash (/) is used followed by double quote or single quote.
Triple double quotes are used for declaring long multi-line strings to the variable. When this is preceded by f like in the following example, the variables can be concatenated at those spots mention with curly braces ( {} )
Comment with a minimum of 10 words.