Sen. Edward M. Kennedy (D-Mass.) and Lillian Carter showed up on the same platform here today and both managed to avoid saying anything controversial about Iran.

Mrs. Carter, the president's mother, did so by refusing to say anything on the subject, Kennedy said a little, but not much.

The senator made it clear that he wants to end the flap that sprang up this week after he unleashed a acathing attack on the deposed shah of Iran and called for a "public debate" on his right to stay in this country.

Asked about Iran today, Kennedy said State Department assurances that senators would be consulted about the shah's future status "resolved the question as far as I'm concerned."

Kennedy stuck to his basic point, repeating his assertion that "support for the hostages does not necessarily mean support for tahe shah." But the declined numerous media invitations to say more.

Mrs. Cartaer created a miniflap of her own last week when she said she would hire a killer to slay the Ayatollah Ruholiah Khomeini if she had the money.

Today she ducked all reporters' questions on Iran, saying, "I have no comment on that. That's a delicate subject."

But she indignantly denied that her son had asked her to stop discussing delicate matters."Absolutely not," she retorted. "Jimmy likes for me to be outspoken."

President Carter's mother and his chief Democratic challenger came to this north-central Alabama town for the dedication of a civic center named after former senator John Sparkman, a native of nearby Mt. Tabor who served four decades in Congress.

Except for sitting on the stage, Mrs. Carter had no part in the program. Joe Berry, president of the local Jaycees, which ran the event, said this was because the White House did not contact him until "sort of the last minute."

Kennedy, one of three Kennedy brothers who served with Sparkman in the Senate was the chief speaker.

He opened with a long encomium on Sparkman's record. In the midst of it, he noted that Sparkman had been leader in the field of housing legislation.

From that point Kennedy waltzed into a sharp attack on President Carter's economic policies, saying that double-digit inflation, the sharp increase in interest rates, and the possibility of recession had undermined Sparkman's efforts to make decent housing available to all.

"What we must not do," Kennedy said, 'is rely on a scorched-earth policy of recession and unemployment to our only answer to inflation. We do not have to throw men and women out of work to reach our goal of bringing prices down."

The audience gave Kennedy a warm reception -- except, of course, for Mrs. Carter. Asked to comment on Kennedy's attacks on her son, she said, "I was trying to keep my mind off what he was saying and think about what Jimmy was doing right then. That's the truth."

Kennedy flew from Alabama to Iowa for 2 1/2 days of campaigning in the state where the first Carter-Kennedy confrontation of the 1980 election year will occur.

Kennedy's traveling campaign staff said he was likely to avoid the troublesome subject of Iran for the time being and concentrate instead on jabs at inflation and interest rates under Carter's presidency.