Write a program to find the last position of a given substring in a given string
Topic: Write a program to find the last position of a given substring in a given string
Solution
str1 = "Emma is a data scientist who knows Python. Emma works at google." print(f"Original String is: {str1}") index = str1.rfind("Emma") print(f"Last occurrence of Emma starts at {index}")
List all Python Programs