Question: Last president that was not a democrat or republican?
Disambiguated questions and answers: question: Last president that was not technically a democrat or republican, as part of the National Union Party?
Last president that was not a democrat or republican but part of the Whig Party?
answer: Andrew Johnson
Johnson
Millard Fillmore
Fillmore
Natural Questions answer: Millard Fillmore (from the Wikipedia article "List of Presidents of the United States")