In this video we are going to Discuss About the Strings in detail in Python With the help of Live examples.
Strings are nothing but collection of Characters for example :
"Actions Speak Louder than words"
There are basically four ways for creating Strings in python
1.Single Quotation
2.Double Quotation
3.Single Triple Quotation
4.Double Triple Quotation
Item Access operator is [] which are used to Accessing the elements of the string or tuple or list
Slice operator is : used to access a particular elements from the string
You can take one argument --- it should be an integer
You can take two arguments - Separated by Colon
and Also 3 arguments -- separated by 2 colons
If you are taking a single Number it will return the character at that index
Negative indexes are surprisingly useful, especially -1 which always gives us
the last character in a string. Accessing an out-of-range index (or any index in
an empty string) will cause an IndexError exception to be raised.
The slice operator has three syntaxes:
seq[start]
seq[start:end]
seq[start:end:step]
Strings in Python - Item Access and Slice Operator in Python - Part 4
#Slice #SliceinPython #SliceOperator