1# using rindex()
2test_string = "abcabcabc"
3# using rindex()
4# to get last element occurrence
5res = test_string.rindex('c')
6# printing result
7print ("The index of last element occurrence: " + str(res))
8
9OUTPUT:
10 The index of last element occurrence: 8
1# using rindex()
2test_string = "abcabcabc"
3
4# using rindex()
5# to get last element occurrence
6res = test_string.rindex('c')
7# printing result
8print ("The index of last element occurrence: " + str(res))
9
10OUTPUT:
11 The index of last element occurrence: 8