Embed presentation


![© SkillBrew http://skillbrew.comAccess a character in string3message = 'Welcome to Python'print message[0]print message[1]print message[2]print message[3]print message[4]Output:Welcostr[index]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-3-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comNegative Indexes4message = 'Welcome to Python'print message[-1]print message[-2]print message[-3]print message[-4]Output:nohtstr[-index]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-4-2048.jpg&f=jpg&w=240)










![© SkillBrew http://skillbrew.comStrings are immutable15>>> message = 'Python is awesome'>>> message[0] = 'j'TypeError: 'str' object does not supportitem assignment>>> message = 'Python is awesome'>>> del message[0]TypeError: 'str' object does not supportitem deletion.Python stringscannot be changed](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-15-2048.jpg&f=jpg&w=240)


![© SkillBrew http://skillbrew.comSlicing18message = 'Python is awesome'print message[0:5]print message[7:10]print message[10:17]print message[:]print message[5:]print message[:6]Outputs:PythoisawesomePython is awesomen is awesomePythonstr[start:end]start: substring starts from this elementend: end of substring excluding the element at this index](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-18-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comSlicing (2)19str[start:end]1. Slicing always returns a new string. Remember strings areimmutable2. If you don’t provide start the substring starts from the beginningof the string. eg: message[:5]3. If end is not provided the substring runs till the end of thestring4. If both start and end are missing the entire string is returned](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-19-2048.jpg&f=jpg&w=240)





Strings in Python are sequences of characters that can be manipulated and accessed using indexes and slicing operations. A string's individual characters can be accessed using indexes like str[0], with negative indexes counting backwards from the end. The length of a string can be found using len(str). Strings are immutable but their values can be reassigned. Strings can be concatenated with + and checked for substrings with the in operator. They support various quote styles and multiline strings using triple quotes.
Introduction to Skillbrew and presentation by Pavan Verma on Python Programming Essentials.
A string is defined as a sequence of characters; example: 'Welcome to Python'.
Demonstration of accessing string characters using positive indexes, outputting individual characters.
Illustration of accessing string characters using negative indexes, retrieving characters from the end.
Using the len() function to determine the length of the string, example output is 17.
Explains that single and double quotes can be used interchangeably for string literals.
Shows how to escape quotes within quoted strings using opposite type quotes.
Introduction to triple quotes for multi-line strings, beneficial for long text.
Clarifies that single and double triple quotes function the same; they can be used for docstrings.
Highlights that there is no separate char data type in Python; a character is a string of length 1.
Reiterates that single and double quoted strings are fundamentally the same in Python.
Demonstrates string concatenation using the + operator with examples.
Explains TypeError encountered when concatenating a string with a non-string type.
Shows how to convert non-string types to strings using str() for concatenation.
Describes that strings cannot be modified in place; show TypeErrors for item assignment.
Clarifies that while strings are immutable, variables can point to different strings.
Defines string slicing as a method to extract substrings or parts of the string.
Shows examples of string slicing, including specific index ranges and full string returns.
Outlines key concepts of slicing, stating slices return new strings and describe behavior with indexes.
Explains the 'in' operator for checking substring presence and provides examples.
Summarizes key topics covered: definitions, access methods, quote usage, string operations, immutability.
Provides links to tutorials and references on Python strings for more in-depth learning.
Empty conclusion slide.


![© SkillBrew http://skillbrew.comAccess a character in string3message = 'Welcome to Python'print message[0]print message[1]print message[2]print message[3]print message[4]Output:Welcostr[index]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-3-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comNegative Indexes4message = 'Welcome to Python'print message[-1]print message[-2]print message[-3]print message[-4]Output:nohtstr[-index]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-4-2048.jpg&f=jpg&w=240)










![© SkillBrew http://skillbrew.comStrings are immutable15>>> message = 'Python is awesome'>>> message[0] = 'j'TypeError: 'str' object does not supportitem assignment>>> message = 'Python is awesome'>>> del message[0]TypeError: 'str' object does not supportitem deletion.Python stringscannot be changed](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-15-2048.jpg&f=jpg&w=240)


![© SkillBrew http://skillbrew.comSlicing18message = 'Python is awesome'print message[0:5]print message[7:10]print message[10:17]print message[:]print message[5:]print message[:6]Outputs:PythoisawesomePython is awesomen is awesomePythonstr[start:end]start: substring starts from this elementend: end of substring excluding the element at this index](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-18-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comSlicing (2)19str[start:end]1. Slicing always returns a new string. Remember strings areimmutable2. If you don’t provide start the substring starts from the beginningof the string. eg: message[:5]3. If end is not provided the substring runs till the end of thestring4. If both start and end are missing the entire string is returned](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m7-strings-140819043158-phpapp02%2f75%2fPython-Programming-Essentials-M7-Strings-19-2048.jpg&f=jpg&w=240)



