At the audience, Francis repeatedly cited the “Prayer for Good Humor” attributed to St. Thomas More, which he said he had prayed for 40 years. “Do you know that prayer? You should know it,” he said.

He also shook hands with every person present.

“I said, ‘Thank you for inviting me and God bless you,’” Ms. Louis-Dreyfus related afterward. “And he said, ‘God bless you,’ so that was something.” She added: “He spoke beautifully — I mean, they gave us a translation. So I actually think his comments were gorgeous.”

Whoopi Goldberg, who has joked that she offered the pope a cameo in the movie “Sister Act 3” during a meet-up with him last year — “he seems to be a bit of a fan,” she offered at the time — said that this visit had been “very fast and really loving and made me happy.”

Some of the comedians at Friday’s event have been involved in projects that have raised Catholic eyebrows — including Mr. Rock, who played Rufus, “the 13th apostle,” in the 1999 film “Dogma,” which some Christian groups criticized as being disrespectful and blasphemous. In an interview at the time, the comedian defended the film, saying, “You’re more disrespectful to God if you get up in arms over this.”

At the end of audience, Francis blessed those present. “Continue to cheer people up, especially those who have the hardest time looking at life with hope,” he told them. “Help us, with a smile, to see reality with its contradictions, and to dream of a better world!”

The pontiff then returned to more serious matters: He traveled to southern Italy to join the Group of 7 summit, a gathering of leaders from the world’s wealthiest large democracies, in a discussion on the implications of artificial intelligence.

world