Implement Depth First Search Algorithm Python If Statements