Questions tagged [last-occurrence]

The last occurrence is the first occurrence starting backwards. Used for questions related to finding the last occurrence of specified data in a data set, matching the last occurrence of a pattern match from a string, or referencing the previously found occurrences.

The last occurrence is the first occurrence starting backwards. Used for questions related to finding the last occurrence of specified data in a data set, matching the last occurrence of a pattern match from a string, or referencing the previously found occurrences.

46 questions
-2
votes
3 answers

Replace the string in last occurrence using Python

I need to replace the string in last occurrence after splitting the string I have tried the below way but it is giving incorrect output like 1.120 below is the code which I have tried. y = "1.19-test" if '-' in y: splt =…
moong
  • 53
  • 1
  • 8
1 2 3
4