A sensor attached to a living body includes a sensor body that outputs a signal corresponding to biological information, and a cable that is connected to a sensor body and transmits the signal. The cable has a first portion having a first flexibility and a second portion having a second flexibility lower than the first flexibility. The second flexibility enables the second portion to be bent, and is able to retain a shape of the second portion in a bent state.