Electronic device and method for operating electronic device

Method of operation of an electronic device and an electronic device in accordance with various embodiments of the housing; display; A touch sensor; Pen sensor; It may include a pressure sensor and a processor. The processor using the pressure sensor sensing a pressure of the external object on the display and, if the external object comprises a conductor, by using the touch sensor detects a touch position of the external object, the external the object is, if the stylus penin configured to be capable of transmitting an electromagnetic signal in the pen sensor, using the pen sensor detects a touch position of the external object and the touch-sensors and / or non-detection of the external object to the pen sensor If, it detects the touch position of the external object using the pressure sensor, the touch sensor, a pen sensor, and / or the touch position detected by the pressure sensor, and based at least partially on the pressure detected by the pressure sensor and, it is possible to perform at least one function. Through this, if the touch sensor does not detect contact between the external object and a display, it is possible to use the pen sensor and / or a pressure sensor to accurately detect the contact position between the external object and the display.