ATHENS — Having warned of the risks of a Trump presidency, President Obama returned on Wednesday to a more optimistic vision of the future of the United States, as part of his final international tour while in office.

“American democracy is bigger than any one person,” Mr. Obama told an audience in Athens, before he departed for Berlin. “That is why we have a tradition of the outgoing president welcoming the new one — as I did last week.”

But he also acknowledged that such transfers of power were not always easy, and he noted that the diversity of American society made governing a challenge.

“As you may have noticed, the next American president and I could not be more different,” Mr. Obama said to a ripple of laughter.