The House of Representatives, when assembled, shall choose a Speaker and its other officers, and the Senate shall choose its officers, except the President, and each house shall judge of the qualifications and elections of its own members, but a contested election shall be determined in such manner as shall be directed by law.