Q: This task involves creating answers to complex questions, from a given passage. Answering these questions, typically involve understanding multiple sentences. Make sure that your answer has the same type as the "answer type" mentioned in input. The provided "answer type" can be of any of the following types: "span", "date", "number". A "span" answer is a continuous phrase taken directly from the passage or question. You can directly copy-paste the text from the passage or the question for span type answers. If you find multiple spans, please add them all as a comma separated list. Please restrict each span to five words. A "number" type answer can include a digit specifying an actual value. For "date" type answers, use DD MM YYYY format e.g. 11 Jan 1992. If full date is not available in the passage you can write partial date such as 1992 or Jan 1992. If you find multiple spans, please add them all as a comma separated list. Please restrict each span to five words.
Passage: Italy had seized military control over Libya from the Ottoman Empire during the Italo-Turkish War in 1912, but the new colony swiftly revolted and transferred large areas of land to Libyan local rule. Conflict between Italy and the Senussis - a Muslim political-religious tariqa based in Libya - erupted into major violence during World War I when the Senussis in Libya collaborated with the Ottomans against Italian troops. The Libyan Senussis also escalated the conflict with attacks on British forces in Egypt. Warfare between the British and the Senussis continued until 1917. In 1917 an exhausted Italy signed the Treaty of Acroma that acknowledged the effective independence of Libya from Italian control. In 1918, Tripolitanian rebels founded the Tripolitanian Republic, though the rest of the country remained under nominal Italian rule. Local agitation against Italy continued, such that by 1920 the Italian government was forced to recognise Senussi leader Sayid Idris as Emir of Cyrenaica and grant him autonomy. In 1922 Tripolitanian leaders offered Idris the position of Emir of Tripolitania. However before Idris was able to accept the position, the new Italian government of Benito Mussolini initiated a campaign of reconquest. From 1923 to 1924, Italian military forces regained all territory north of the Ghadames-Mizda-Beni Ulid region, with four fifths of the estimated population of Tripolitania and Fezzan within the Italian area; and Italian forces had regained the northern lowlands of Cyrenaica in during these two years. However attempts by Italian forces to occupy the forest hills of Jebel Akhtar were met with popular guerrilla resistance. This resistance was led by Senussi sheikh Omar Mukhtar.
Question: How many years did it take for Libya to obtain independence from Italy?
Answer type: Number
A:
5.