"I like hanging out with women," Obama said, as co-host Joy Behar teased him about the standing ovation and cheers he received when he took the stage for the ABC show in New York.
Asked if he had intended to announce his support of gay marriage on the program before Vice President Joe Biden opened up the discussion and Obama was then pressured to comment on the matter last week, the president replied: "It was a possibility. It was. We had been discussing it for a few weeks and we thought, 'What are formats where we can talk about it not just as a policy issue but as a personal issue?' And all of you came to mind."
Obama said he was OK with Biden talking about the matter before he did because it came out of a "generosity of spirit."
"He is the most honest, straightforward guy," Obama said. "He's warm; he tells you what he thinks. We talked about it and what I said was, 'I'm never going to blame anybody for telling what they believe.' I think it's important for everybody in my administration to feel disciplined, make sure we're getting the message out there, but, at the same time, on issues of principle I always admire people who go ahead and speak their minds."
Co-host Barbara Walters then told the president she was happy he chose ABC's "Good Morning America" on which to talk about his support of gay marriage instead of a program on a rival network, but admitted she wished he had called "The View."
"What can I tell you?" Obama laughed.
Elisabeth Hasselbeck, the lone Republican on the five-host panel of "The View," smiled and joked, "You have my cell..."
Co-host Sherri Shepherd asked the president if he thinks the upcoming election will be as tight as it was in 2008 when he ran against Sen. John McCain and he replied with a chuckle: "When your name is 'Barack Obama,' it's always tight. 'Barack Hussein Obama.' I think it's going to be tight because the country has gone through a very difficult time -- the worst financial crisis, the worst economic crisis since the 1930s -- and the fact is that as much progress as we've made -- 4 million jobs over the last couple of years, 1 million in the last six months -- despite the fact businesses are investing again and despite the fact we're seeing a steady bump up in economic indicators, there are a lot of folks who are still hurting out there. There are a lot of folks still looking for work."
So, who's going to win the election? Walters wanted to know.
"Oh, I'm going to win," he said, high-fiving hands with Behar.
"Because it was a ballplayer; that's how I know, from watching basketball," Obama said.
Asked to name the title of the controversial sex book on millions of women's bed-side tables, Obama pretended he never heard of "Fifty Shades of Grey" and said: "I don't know that. But I'll ask Michelle when I get home what's going on."
He also knew Shepherd had competed on "Dancing with the Stars" and that a gay couple was at the center of the popular sitcom "Modern Family."
He also could name the superheroes in the blockbuster "The Avengers," but did not know that Jessica Simpson had given birth to her first child.
Before the show ended, Walters confessed she takes home embossed paper towels when she visits the White House.
"You steal our stuff?" Obama quipped, patting her on the back in reassurance. "You can see Secret Service is saying, 'After the program, we're going to recover our stolen items.'"
His interview on Tuesday's edition of the program marks the second time he has appeared on the show since taking office and his fourth visit overall.