There is a big myth that Gandhi and Congress were responsible for forcing the English out.
The truth is that the two movements that Gandhi Started,
Non-Cooperation and Quit India both failed to achieve there objectives.
Gandhi was nothing more than headache and occasionally mild to moderate stomach pain for the British. And people just take medicines to cure pain, not die of these pains.
After the second world war, when the British were severly bankrupt, India became more of a burden for them than a profit making colony. MountBaten was given time to grant independence by mid of 1848 or before that. He was in such a hurry that he left India much before that.
There was a Royal India Navy revolt in Bombay. Read carefully what the Atlee had to say at the time of independence.
""""Certainly the British Prime Minister at the time of Independence, Clement Attlee, deemed the contribution of Quit India as minimal, ascribing stupendous importance to the revolts and growing dissatisfaction among Royal Indian Armed Forces as the driving force behind the Raj’s decision to leave India"""""
Last but not the least, India was partitioned at the will and approval of the British and they were the overlords in deciding the future boundaries, clearly indicating that they were NOT FORCED to leave India. It was just a TRANSFER of Power to the Indians and Pakistanis.
read American , French and Russian revolutions. As these revolutions forced the rulers out of office.