I want to sort list of countries based on continents, but want to keep 'Rest of Asia' and 'Rest of America' at the end. How can we modify the sort function
A = ['China', 'India', 'Brazil', 'Canada', 'Rest of Asia', 'Rest of America', 'USA', 'UAE', 'Sri Lanka']
sorted(A)
I want to have the result where Rest of America and Rest of Asia should come in the end
like: ['China', 'India', 'Brazil', 'Canada', 'USA', 'UAE', 'Sri Lanka', 'Rest of Asia','Rest of America']