
Answer:
Following are the code to this question:
def after_second(s,sub):#defining a method a fter_second
first = s.find(sub)#defining a variable first that hold method find value
if first != -1:#defining if block to check first variable value not equal to -1 using slicing
s = s[len(sub)+first:]#defining s variable to calculate sub parameter length of parameter and use slicing
second = s.find(sub)#defining second variable to calculate find method value
if second != -1:#defining if block to calculate second variable slicing
return s[len(sub)+second:]#return s variable value
print(after_second("heyyoheyhi","hey"))#defining print method to call after_second method
print(after_second("11223344554321","3"))#defining print method to call after_second method
Output:
hi
44554321
Explanation:
In the above python code a method "after_second" is declared, that accepts two-variable "s, and sub" as the parameter inside the method a first variable is declared that uses the inbuilt method "find" to find the value and stores it value. In the next step, two if blocks are used, in which both if blocks use the slicing to checks its value is not equal to "-1".