January 2019
Beginner
318 pages
8h 23m
English
We can access characters from strings using slicing by using square brackets. We can also access characters from strings between the specified range. Refer to the following example:
#!/usr/bin/python3str1 = 'Hello Python!'str2 = "Object Oriented Programming"print ("str1[0]: ", str1[0])print ("str2[1:5]: ", str2[1:5])Output:str1[0]: Hstr2[1:5]: bjec
Read now
Unlock full access