Page 150 - 2626_South Point_C-8
P. 150
Program 3: To print special symbols using escape sequences.
You will get the following output:
Traversing a String
Traversing means visiting each element and processing it as required by the program. We can access
the characters of a string one at a time using indexing.
There are two ways of indexing a list:
Index with positive integers: Index from left starts with 0.
Index with negative integers: Index from right starts with -1. Syntax for traversing a string:
<name of the string> [index]
Program 4: To access different elements of a string.
You will get the following output:
148 Premium Edition-VIII

