For an incumbent president facing a tough reelection campaign, no public appearance is completely free of political content. But President Obama’s annual back-to-school speech to the nation’s students, delivered Wednesday at Benjamin Banneker Academic High School in Northwest Washington, was about as close as it gets.

In a 20-minute address to Banneker’s 415 students, streamed live to schools across the country by the White House, Obama urged students to take their work seriously but also to experiment.

“That’s what school’s for. Discovering new passions,” Obama said, speaking under the basketball backboard in a packed gym turned steamy from the extra lighting.

“That’s why one hour you can be an artist; the next, an author; the next, a scientist,” he said. “Or a historian. Or a carpenter. This is the time when you can try out new interests and test new ideas.”

Obama told students he didn’t want to be “another adult who stands up to lecture you like you’re just kids,” prefacing a series of fairly lecture-like remarks.

“It starts with being the best student you can be,” said Obama, accompanied by Education Secretary Arne Duncan and addressing a crowd that also included Mayor Vincent C. Gray (D), D.C. Schools Chancellor Kaya Henderson and D.C. Council Chairman Kwame R. Brown (D).

“Now that doesn’t always mean you have to get a perfect score on every assignment. . . . It means you have to keep at it,” Obama said. “It means you have to work as hard as you know how.”

As the setting for a presidential speech to inspire and exhort school kids, Banneker might not have been the best fit. Students there seem to be doing just fine without Obama’s work-hard-dream-big pep talk.

Banneker, where admission is by application only, is the top of the pyramid for D.C. public high schools. Ninety-four percent of its sophomores read at proficiency level or better on the 2011 D.C. Comprehensive Assessment System. The pass rate in math was nearly 98 percent. Only the School Without Walls did better. In addition, Banneker boasts a better than 95 percent graduation rate, more than 20 points above the citywide average, according to the latest available data. Half the students are eligible for free or reduced price lunch.

But this was no ordinary motivational talk, of course.

“We are very proud the president chose Benjamin Banneker,” said Donae Owens, the student body president and an aspiring architectural engineer, who introduced Obama “president to president.” She called it a “historic event for all of us.”

“What he said was very meaningful to us,” said Monet Little, a senior who wants to study international affairs at Penn State. “Students tend to block out a lot of this stuff.”

Benjamin Acquah of Jefferson Middle School, who had been invited to the event, observed that the speech “was shorter than I expected,” but that was okay.

“He socialized,” Acquah said of Obama’s speaking style. “He made sure we understood what he was talking about.”

No one was more pleased than Banneker Principal Anita Berger.

“Be proud. Be proud that we’re D.C. public schools,” she said before Obama took the stage.

She said later that despite its selective admissions process — more than 450 applications for 140 seats this fall — Banneker’s success could be duplicated in any of the District’s open-enrollment high schools.

“You have to have a group of committed adults” — that means everyone from administrators to custodial staff, said Berger, who has led the school for seven years.

Not everyone seemed to buy in completely. After the speech, a group of Banneker teachers seated in the bleachers briefly flashed a small sign that said, “No More Standardized Testing.”