A printer, comprising: a cassette mounting portion, into which is mounted and from which is removed a tape cassette in an up-down direction, the tape cassette including a box-shaped cassette case, a tape, and an indicator portion, the cassette case being provided with a top surface, a bottom surface, a front surface and a pair of side surfaces, the tape being a printing medium that is contained in the cassette case, and the indicator portion being provided on the front surface and indicating a type of the tape; a printing head that performs printing on the tape in a case where the tape cassette has been mounted in the cassette mounting portion; a platen roller that faces the printing head and that can be pressed against the printing head through the tape; a roller holder that supports the platen roller and that can rotate, around a holder shaft that is parallel to the up-down direction, between a first position that is a position where the platen roller is pressed against the printing head and a second position that is a position where the platen roller is separated from the printing head; a sensor that detects the type of the tape that the indicator portion indicates, wherein the sensor is a mechanical sensor that has a switch terminal that can advance and retract; a determination unit that determines the type of the tape based on advancing and retracting of the switch terminal of the mechanical sensor; a sensor holder that holds the sensor between the holder shaft and the platen roller and that can move between a third position that is a position where the sensor is close to the indicator portion and a fourth position that is a position where the sensor is separated from the indicator portion; wherein the roller holder, in a case where the sensor holder moves to the third position, rotates to the first position before the switch terminal of the sensor moves close to the indicator portion, and in a case where the sensor holder moves to the fourth position, rotates to the second position after the switch terminal of the sensor has separated from the indicator portion, wherein a protective portion that is provided on the roller holder and is provided above the switch terminal of the sensor, that, in a case where the roller holder rotates to the second position, moves to a position where it is separated from the tape cassette that is mounted in the cassette mounting portion, and that, in a case where the roller holder rotates to the first position, moves to a position where it will come into contact from below with the tape cassette that is mounted in the cassette mounting portion. a cassette mounting portion, into which is mounted and from which is removed a tape cassette in an up-down direction, the tape cassette including a box-shaped cassette case, a tape, and an indicator portion, the cassette case being provided with a top surface, a bottom surface, a front surface and a pair of side surfaces, the tape being a printing medium that is contained in the cassette case, and the indicator portion being provided on the front surface and indicating a type of the tape; a printing head that performs printing on the tape in a case where the tape cassette has been mounted in the cassette mounting portion; a platen roller that faces the printing head and that can be pressed against the printing head through the tape; a roller holder that supports the platen roller and that can rotate, around a holder shaft that is parallel to the up-down direction, between a first position that is a position where the platen roller is pressed against the printing head and a second position that is a position where the platen roller is separated from the printing head; a sensor that detects the type of the tape that the indicator portion indicates, wherein the sensor is a mechanical sensor that has a switch terminal that can advance and retract; a determination unit that determines the type of the tape based on advancing and retracting of the switch terminal of the mechanical sensor; a sensor holder that holds the sensor between the holder shaft and the platen roller and that can move between a third position that is a position where the sensor is close to the indicator portion and a fourth position that is a position where the sensor is separated from the indicator portion; wherein the roller holder, in a case where the sensor holder moves to the third position, rotates to the first position before the switch terminal of the sensor moves close to the indicator portion, and in a case where the sensor holder moves to the fourth position, rotates to the second position after the switch terminal of the sensor has separated from the indicator portion, wherein a protective portion that is provided on the roller holder and is provided above the switch terminal of the sensor, that, in a case where the roller holder rotates to the second position, moves to a position where it is separated from the tape cassette that is mounted in the cassette mounting portion, and that, in a case where the roller holder rotates to the first position, moves to a position where it will come into contact from below with the tape cassette that is mounted in the cassette mounting portion.