He became an agnostic by the time he left school. He studied medicine at Edinburgh University from 1876 to 1881. He wrote short stories in his spare time. In 1882, he started working as a doctor in Southsea. He carried on writing short stories while he waited for patients. His first Sherlock Holmes story that was published was "A Study in Scarlet".