While in isolation in hospital following her hysterectomy, Fry said a surgeon told her that four of her lymph nodes had appeared enlarged.

She added: “I was in this hospital bed on my own and no-one could come and visit me for over a week, with nothing but the sheer terrifying drop of the end of my existence in front of me – it was horrific.”

Fry described not being able to “think back to happy things that… have already happened because it is sad”, while also not being able to “look forward to things you are hopeful about because it doesn’t feel like it is there”.

She also said she asked her then husband to set up FaceTime in the corner of a room so she could watch their two young daughters play while she was in hospital.

“I didn’t want them to see me, it was too much,” she said.

But she added: “Going through something like that I don’t think I would swap it.

“I think it was honestly such a gift to have that experience when you’re 36 and then come out the other side of it.”

The presenter grew up in a working-class family and studied mathematics at University College London.

She later completed a PhD in fluid dynamics, and last year became Cambridge University’s first professor of the public understanding of mathematics.

Fry has fronted BBC science series including The Future with Hannah Fry and The Secret Genius of Modern Life.

She was banished in the latest series of The Celebrity Traitors after being exposed as a traitor.