President Obama urged Africa's would-be presidents and prime ministers to focus on actions, not status, during a forum in Washington Wednesday.

"Worry less about what you want to be and worry more about what you want to do, because those are two different things," Obama advised the young men. Washington attracts people who decide very young what they want to be and think less about what it means to hold office, he said.

Many in Washington think, "'I want to be a congressman.' And then they are doing everything they can to be a congressman. And then once they are a congressman, they don't know why they're a congressman. They just know they want to stay a congressman," Obama said.

He said part of his success is that he didn't worry about his next election.

"If you lose, there are other ways to make a living. It's not a tragedy," he said about his attitude toward his successful 2004 long-shot Senate bid.

'There were times during my political career that I thought, 'You know what? This is not going so well,'" he admitted, noting his failed attempt to topple Rep. Bobby Rush for a Chicago-based House seat in 2000. "'If I don't win this U.S. Senate race, I'm getting out of politics — I'm going to go do something else,'" Obama recalled thinking.

That gave him the perspective he needed to push for big changes during his first term in the White House, regardless of the consequences, he said.

During his push for the Affordable Care Act, he wasn't worried about re-election because there was "no point in me being in office if I can't actually do something with the office," he said. So he looked to 2012 and thought: "'If I lose, I'll be upset. It'll be a little embarrassing, but I'll be OK.'"

But Obama also said luck is as much of a factor in politics as ability.

He said his rise to prominence after speaking at the 2004 Democratic National Convention, a slot that was somewhat "accidental," was mostly due to good fortune.

"When you think about me being president of the United States, it was quite unlikely" back in 2008, he said.

"I gave a pretty good speech," but suddenly "my name's everywhere and I'm on television," he said. "I am no more smarter today than I was yesterday," he recalled telling a friend the next day. "I didn't suddenly, magically become so much better than I was when I was just a state senator. Some of it had to do with just chance — it was luck."

He advised his African audience to remember they cannot totally control fate.

But "you do have control over being useful and doing good work in your communities," he said. "If you stay focused on that, then maybe success comes in politics. But if it doesn't, you will still be able to wake up every morning and say: 'You know what? I'm making a difference. I'm doing good work.'"

He also assured the group in Washington through the Young African Leaders Initiative, which he started in 2013 and saw 40,000 fellowship hopefuls apply for 1,000 slots, that his focus on Africa and Asia would outlast his tenure.

He said he couldn't promise that future presidents would continue the program but hopes they will.

"Even after I'm president, this is a program I will continue to work with," Obama promised. It's "something I am very, very proud of."

He also encouraged the man who asked him what would become of those efforts to focus on human capital back at home.

"A great achievement of the United States is our university system, which really is unparalleled in the world," Obama said. Countries, governments that invest in their people, have a "huge advantage" over those that focus solely on natural resources, for example, in the global marketplace, he said.

He noted that Singapore, a "tiny" island nation that the White House feted Tuesday with an official state visit, is one of the smallest, but "has one of the most wealthy, well-educated, advanced populations in the world" because it focuses on educating its people and creating a dynamic economy.

Obama said he hosts events such as Wednesday's, and created organizations such as the Young Southeast Asian Leaders Initiative, because it's good policy.

"We're doing this not just because I love the people of Africa, but also because the world will not be able to deal with climate change or terrorism or expanding women's rights — all the issues that we face globally — without a rising and dynamic and self-reliant Africa," Obama said. "And that, more importantly than anything else, depends on a rising generation of new leaders. It depends on you.

"That's why six years ago, I launched the Young African Leaders Initiative, because I've always believed that one person can be a force for positive change, that one person, as Bobby Kennedy famously said when he visited Soweto, that one person can be like stone, a pebble thrown in a lake, creating ripples. Ripples of hope, he called it," he said about the slain attorney general's visit to the South African town in the 1960s.