WASHINGTON — President Obama on Wednesday said bluntly that the longstanding accusations that the comedian Bill Cosby drugged women for sex would constitute nothing less than rape, and he said the country should have “no tolerance” for such actions. In his first comments on the decades-old accusations against Mr. Cosby, the president sought to carefully avoid a direct comment on civil legal actions that have been lodged against the longtime comedian and television star by several women in recent years. And he dismissed the idea that he might revoke the Presidential Medal of Freedom conferred on Mr. Cosby by President George W. Bush in 2002. “There’s no precedent for revoking a medal,” Mr. Obama said in answer to an off-topic question during a long news conference that was otherwise focused on the nuclear deal with Iran announced Tuesday. “We don’t have that mechanism.” He added that he made it “a policy not to comment” on cases in which legal action was pending. But after a noticeable pause, Mr. Obama did comment, if indirectly, suggesting that the facts involving one of the world’s best-known entertainers should not be taken lightly. “I’ll say this,” Mr. Obama said. “If you give a woman or a man, for that matter, without his or her knowledge, a drug, and then have sex with that person without consent, that’s rape.” “And this country, any civilized country, should have no tolerance for rape,” the president added. Mr. Obama’s remarks came days after the release of portions of a years-old court record in which the former “Cosby Show” star admitted to having obtained prescriptions for quaaludes, a sedative, in the 1970s. He testified under oath that he had given the sedative to at least one woman. In the unsealed document, Mr. Cosby was asked whether it was “in his mind that you were going to use these quaaludes for young women that you wanted to have sex with.” Mr. Cosby replied, “Yes.” In the deposition, Mr. Cosby, now 77, did not admit to drugging unwitting women, suggesting instead that the women had consented to taking the pills and having sex with him. Even so, some of his accusers have treated the deposition as a vindication of their claims. Since the documents’ release, some people have urged Mr. Obama to find a way to revoke Mr. Cosby’s Presidential Medal of Freedom. White House officials indicated previously that they did not believe there was any precedent for a president to do that, but Mr. Obama had never been asked the question directly in public. His decision to answer the question, and to go further by commenting on the nature of the accusations against Mr. Cosby, suggests that Mr. Obama was eager to lend his voice to the discussion about sexual violence that has arisen from the scandal. Mr. Obama has often used news conferences to weigh in on topics of intense interest in popular culture. In one of his first news conferences as president, in 2009, he said he thought a white Cambridge police officer was “stupid” to have arrested a black Harvard professor. That comment led to a weeklong furor that ended after Mr. Obama sat down for a “beer summit” with the officer and the professor at the White House.