BELGRADE, Yugoslavia (AP) _ Secretary of State George P. Shultz left Belgrade today, completing a six- nation European tour in which he urged better international cooperation against terrorism.

Shultz labeled his eight days of low-key public appearances a ''learning experience,'' especially about Eastern European countries such as Hungary, Romania, and Yugoslavia. He also visited Britain, West Germany and Belgium.

Before boarding his plane, Shultz said, ''It has been a very useful exchange of views,'' and added, ''we touched on just about any subject.''

Seeing the American flag flutter atop a light tower over the airport, the secretary of state said he appreciated the gesture as ''a very positive symbol of relations between our two countries.''

Yugoslav Foreign Minister Raif Dizdarevic braved cold and windy weather to see Shultz's plane take off. Those present applauded.

On Tuesday, Shultz strongly admonished countries to stop giving terrorists ''a place to hide.''

The secretary of state angrily slammed his hand on the table at a news conference at Dizdarevic's suggestion that the causes of terrorism be considered in deciding how to treat terrorists.

The incident occurred at a news conference in which Shultz and Dizdarevic were asked about the hijacking of the Italian cruise ship Achille Lauro in October by Palestinians. An American tourist, Leon Klinghoffer, was killed during the hijacking.

Despite a U.S. request, both Italy and Yugoslavia refused to detain Mohammed Abbas, a Palestine Liberation Organization official the United States suspects of masterminding the piracy.

The Yugoslav minister said he agreed with Shultz that terrorism must be stopped, but added that nations also should also understand the conditions and causes of violent behavior, an opinion often expressed by governments that recognize the PLO.

Shultz reacted sharply. ''Hijacking the Italian ship, murdering an American, torturing and holding a whole bunch of other Americans is not justified by any cause that I know of,'' Shultz said.

''It's not connected with any cause, it's wrong,'' he said, slamming his hand on the table.''

''The international community must step up to this problem and deal with it, firmly, definitely,'' he said. ''There must be no place to hide for people who do that kind of thing.''

Earlier in the news conference, Shultz said that in his private meetings with Yugoslav leaders he had expressed ''disappointment'' that Abbas had been allowed to pass freely through the country.

In a quick series of events after the hijackers surrendered and were put on a plane Egytian authorities, U.S. warplanes from the aircraft carrier Saratoga diverted the plane to Italy.

Four Palestinians were arrested and charged with hijacking the ship. But Italian authorities permitted Abbas, also a passenger aboard the plane, to leave the country on Oct. 12.

He surfaced in Yugoslavia the next day, but dropped from sight shortly afterward. Shultz said Abbas had gone to Iraq.

The Yugoslav foreign minister said his government had criticized the Achille Lauro hijacking when it took place. At the same time, he repeated his government's view that the PLO is a peaceful and legitimate representative of the Palestine people, and should not be held responsible for terrorist acts by individuals.

''Hijackers and terrorists operate across national boundaries and so we seek to cooperate with other countries,'' Shultz said. ''We need to create an atmosphere so terrorists have no place to hide and are brought to justice.''

A U.S. official, speaking on condition he not be identified, said Shultz was less vehement in his private talks with Yugoslav leaders, including Prime Minister Milka Planinc.

Shultz discussed U.S.-Yugoslav trade with Mrs. Planinc, and whether some of the country's large foreign debt can be rescheduled. Among Yugoslavia's economic problems are an annual inflation rate of nearly 80 percent, 15 percent unemployment, and a $19 billion foreign debt.

Of the $1 billion a year in trade between the two countries, Yugoslavia exports about $400 million worth of goods to the United States and imports goods worth about $600 million.

It is one of the few European countries that has a trade deficit with the United States.

''I think I can fairly say, and my Yugoslav hosts did note, that the U.S. market is basically open, and we are ready to receive their goods,'' Shultz told the news conference.