Which sentence is more formal?

 - Trisha didn't enter student politics until her junior year.
 - Trisha did not enter student politics until her junior year.
The first sentence is less formal. You can tell because it uses a contraction (didn't).
The second sentence does not use a contraction, so it is more formal.