Strings in Python - Item Access and Slice Operator in Python - Part 4

Published: 02 April 2020
on channel: Learning With Faraz
134
7

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


On this page of the site you can watch the video online Strings in Python - Item Access and Slice Operator in Python - Part 4 with a duration of hours minute second in good quality, which was uploaded by the user Learning With Faraz 02 April 2020, share the link with friends and acquaintances, this video has already been watched 134 times on youtube and it was liked by 7 viewers. Enjoy your viewing!