28.Take a list with 6 different characters and print the 2nd and 3rd character?
# Python Program to Access
# characters of String
String1 = ['p', 'y', 't', 'h', 'o', 'n']
print("Initial String: ")
print(String1)
# Printing Second character
print("\nSecond character of String is: ")
print(String1[1])
# Printing Third character
print("\nThird character of String is: ")
print(String1[2])
Comments
Leave a comment