Charles Babbage was the first to invent the analytical engine, which is considered to be the world's first general-purpose computer. The analytical engine was designed to perform complex mathematical calculations and was programmable using punched cards. Although Babbage was not able to complete the construction of the analytical engine during his lifetime, his work laid the foundation for the development of modern computers. Therefore, the correct answer is "invent analytical engine".