How does An Endoscope Work?

Endoscope is a long tube with a camery at its one end. It is used to see the inside of the gut. It is either put inside the mouth and down to see the upper part of gut or it is inserted through anus to see the lower part of gut that is colon.