Congress started 2017 in uncharted territory: A controversial real estate developer-turned-reality star effectively hijacked the Republican Party and became president.
And members of Congress ended the year still bewildered by their president, but a little more certain of their place in this new era.
Here are five tough lessons Congress learned in the first year of President Trump that could help them survive next year.
1. Work around Trump, not with Trump: Over and over again, the president proved himself an unreliable dealmaker. Lawmakers would leave a meeting at the White House thinking they had a deal — like Democrats did on protecting "dreamers," or Sen. Lamar Alexander, R-Tenn., did on a bipartisan health-care proposal — only to have him renege or hedge it on Twitter.
Eventually, Republicans settled on writing major legislation themselves, and basically asked the White House to trust them.
It worked on taxes, when Congress passed the first rewrite of the tax code in 30 years. But that strategy failed miserably on an Obamacare repeal effort, where Trump blamed Congress for its failure — and he arguably had a point.
Trump ended the year with virtually no working relationship with Congress, even though at a year-end tax bill celebration, Republican lawmakers couldn't stop praising the president.
But the lack of cohesion could hurt both Congress and the president next year. "One of the biggest challenges that Trump presents congressional Republicans is that he's not well-positioned to help them overcome differences within the party," said Molly Reynolds, a congressional expert at Brookings Institution.
2. Bipartisanship is less useful than it used to be: "This has not been a very bipartisan year," Senate Majority Leader Mitch McConnell, R-Ky., told NPR. That's spot on. Congressional Republicans' two major legislative accomplishments — putting Judge Neil M. Gorsuch on the Supreme Court and passing a tax overhaul — only got done because Republicans went around Democrats.
Bipartisanship isn't entirely dead. A near-unanimous Congress forced Trump to implement more sanctions on Russia. Republicans also needed Democrats to pass a year-end spending bill when conservatives defected.
But 2017 ends with the most high-profile bipartisan compromise still in limbo: a plan to subsidize health insurance premiums for lower-income people.
3. Both parties might be losing control of their base: Just how much sway do Republicans in Washington have over their own voters? It's a fair question to ask, since if Senate Republicans had their way from the start, Luther Strange would be the senator from Alabama, not Democrat Doug Jones.
Republicans tried everything to get the eventual GOP nominee Roy Moore to drop out after he was accused of inappropriately touching a 14-year-old. He stayed in — and lost. It may have just been a preview of Stephen Bannon-backed GOP primary challengers in Nevada and Arizona that could decide the control of the Senate.
Meanwhile, Democrats' base swung far to the left in the Trump era, forcing potential 2020 contenders to scramble to catch up. A number of Democratic senators signed onto a single-payer proposal that has no chance of becoming law right now.
But there's another way to interpret this lesson, at least for Republicans: The base matters less than it used to. Republicans just passed a tax bill that wasn't that popular with their base. Forty percent of Republicans thought they'd be better off if Republicans passed their tax bill, according to a CNN poll. And it's law anyway.
"They learned they don't have to listen to their base," said Norm Ornstein, a congressional ethics expert.
4. It's time to do something on sexual misconduct: Politicians leveraging their power for sex appears to be a systemic, bipartisan problem that has carried on for decades. But in the span of a few weeks, seven sitting members of Congress lost their jobs in the wake of sexual misconduct scandals.
In the post-Harvey Weinstein, current #MeToo era, it's clear that Washington can no longer ignore some very tough questions.
Like: What's creating this culture? What makes one accuser's story more credible than the next? Why did Senate Democrats force out Sen. Al Franken, D-Minn., after the seventh accusation and not the first? Should we question accusers' motives, like Alabama GOP Senate nominee Roy Moore did? How do Democrats answer for former president Bill Clinton's accusers and Republicans for Trump's? Should politics ever trump sex abuse allegations, like when Trump urged Alabama voters to vote for Moore anyway?
And perhaps most importantly, just how equipped is Congress to deal with all these allegations? Right now there's a secret slush fund that lets lawmakers who settle a sexual harassment accusation basically get off without any consequences. Lawmakers didn't have required sexual harassment training until this year. Expect bipartisan work next year on making it easier for accusers to file sexual harassment claims against lawmakers.
5. Ditch Trump, be ready to lose your job: Sens. Jeff Flake, R-Ariz., Bob Corker, R-Tenn., and John McCain, R-Ariz., end the year as three of Trump's most vociferous critics of either party.
It's not a coincidence that two of those senators, Flake and Corker, are not seeking re-election. In fact, Flake basically admitted he couldn't win a GOP primary with his virulent anti-Trump views. (McCain, as we all know, is battling brain cancer.)
The lesson here: If you ask Republican voters to choose between you and Trump, right now, they'll chose Trump.