A group in Italy has named President Anwar Sadat of Egypt one of the world's 10 best-dressed men. The other day, after one of Sadat's innumerable press conferences about affairs of state in the Middle East, a CBS reporter asked if he was pleased or embarrassed to be on that list.

Sadat paused to puff at his pipe.

"Well," he said, "I'm really very proud because I'm a farmer. Whenever there is a farmer who is one of the 10 best-dressed, it is really a pleasure. It doesn't embarrass me at all."

The press laughed, but Sadat was only partly joking. His roots are in the soil of Egypt and his memories of boyhood in his village are one of the keys to understanding him.

"I long for my early days in our modest home in the village, on the banks of the irrigation canal, in the shadow of the raspberry bush, or in the harvest season," he once said. "I am tired of civilization and long for austerity and simplicyt . . . I want to get out and live among the people as an ordinary citizen but I cannot."

Sadat was being disingenuous again. An Egyptian who has known Sadat for years says the president is reworking his own biography as he goes along. Even as a village lad, Sadat was no yokel.

When he was 10, he discovered the teachings of Mahatma Gandhi. His sister told author Edward R. F. Sheehan that Sadat used to dress in a sheet to look like the ascetic Indian and walk through the village leading a goat on a string. At that early age he showed two traits that have marked much of his life - a fierce desire to be rid of the British, learned from Gandhi, and an understanding of costume.

On Sadat's forehead, where his hairline was before it receded, is a dark spot. Many Moslem men have it. It comes from a lifetime of pressing their heads to the ground in prayer.

There is a joke that Sadat got his another way. It is said that in the years when he was the loyal servant of Gamal Abdel Nasser, Nasser used to reach across the conference table and slap Sadat on the head, saying "You, shut up."

It is probably true, as the joke implies, that Nasser had a low opinion of Sadat's mental prowess. For years before he became president, Sadat was regarded as a second-rater and a lightweights.

In all his speeches on international affairs, Sadat proclaims, "I kneel to no one but Allah." He is speaking for himself, the man who was proud to be photographed with his head on the floor of the Al Aqusa Mosque. And in his view he is speaking, metaphorically, for Egypt, the country that with his help stopped taking orders from the British and then from the Russians and then from the ideologues of Pan-Arabism.

Islam is Egypt's state religion, but Sadat's view of it is personal. He says he really believes Jimmy Carter will help him bring peace to the Middle East because Carter is religious too. Unlike other Arab leaders, Sadat tries to keep religion out of state policy.

In his book "Revolt on the Nile," a memoir of the 1952 revolution in which Nasser, Sadat and other conspirators of the "Free Officers Movement" overthrew the pro-British monarchy, Sadat wrote: "Religion is one thing, its exploitation for political purposes quite another. It must not be given a purpose which it does not inherently possess. If a religion is turned into a political system, then fanaticism is born. This confusion of temporal power with the spiritual has been the downfall of many oriental societies."

He wrote that 20 years ago. He put it into practice last summer when he cracked down swiftly and massively on Moslem fanatics who attacked his government as worldly and corrupt. Playing to the Press

Sadat has many public styles - table pounder, brow mopper, lecturere, disciplination, military commander, exchanger of chitchat and light witticisms. But his thinking, those who know him well say, is done in private, at his houses outside Cairo, where he can don a leisure suit or walking shorts for his daily stroll.

It was Sadat who went on the radio to announce the 1952 revolution to his countrymen and again to announce the death of Nasser in 1970. And he had a brief career as a writer for a Cairo newspaper. But his media stardom has developed only recently.

When Sadat first became president, a former assistant recalls, he did not know how to be interviewed and was uneasy on televison. "He talked a lot but he didn't say anything," this assistant said.

The president learned quickly, partly from watching Henry Kissinger. Now Sadat uses the international press the way Kissinger did - manipulating, cajoling, flattering and handing out goodies - knowing the press is the key to public opinion where it maters, in the United States and Israel.

He says things like "I read in Time magazine" or "as I told Barbara Walters." When he gives interviews, which he has been doing two or three times a day lately, his visitors from the press are listed in the local newspapers along with cabinet officials, heads of state and other dignitaries to who he grants audiences. The Moviegoer

In addition to all that time with th press, Sadat passes part of almost every day watching movies.

When Secretary of State Cyrus Vance arrives to see him last summer, he was watching "The Deep."

According to his wife, Jehan, "Every day he must watch a movie; I usually stay for 10 minutes a maximum. I can't see more than one a week. He usually watches two a day, American films. He likes cowboys films. I get fed up. I hear horses running and shotting and I leave the room."

If that leaves little time for the day-to-day details of running an impoverished country, that is fine with Sadat, who has a wel-deserved reputation for impatience with the nuts and bolts of public administration. It can lead to embarassments, great and small.

Thomas P. F. Hoving, then director of the Metropolitan Museum in New York, came here last summer to present Sadat with a few gifts - samples of the replicas from the exhibition of the treasures of the tomb of Tutankhamon. Having had his appointment with the president but could not present the gifts - they were tied up in Egyptian customs, a bureaucratic morass that no number of directives from the president has been able to clean up.

Political observers say it was this same difference to or incompetence at administrative and governmental affairs that led to the blunder of last January. Sadat allowed his economic officers to impose major price increases on staples without preparing the political ground, a resulting in the worst riots in a quarter-century.

That ineptitude seems strange in the man shrewd enough to call in the Soviet ambassador to receive advance notice before he sacked Vice President Ali Sabry, who was Moscow's man in the government. But it is more or less what was expected when he became president. Sadat likes to recall that the CIA and British intelligence said he would not last more than six weeks. Within a few months he had crushed his rivals in a power strugle Sadat always refers to as the "corrective revolution," but since then his reputation has been built on his performance in international affairs.

Even there he had to insist on being taken seriously because outsiders thought so litle of him. A Stalin, Not a Kalinin

According to former Infomation Minister Mohammed Heikal, Sadat once sent for the chief Soviet adviser to the Egyptian armed forces. When he arrived, the Russian found Sadat in the uniform of the supreme comander of the Egyptian armed forces.

"For your information, I am Stalin, not Kalinin," Sadat told the astonished Russian. Kalinin was the front man reviewing Red army troops, Sadat said, but Stalin held the power. He told the Soviet adviser that he wanted to be treated as if he were really in charge, not just a figurehead and said, "If you don't cary out this order of mine I'll treat you exactly as Stalin would have treated you."

Sadat's introduction to world affaris came in an episode that gave little reason to think he would later be a major player in the game of nations.

During World War II Sadat, on behalf of the Free Officers, collaborated with two German spies who came to Egypt in the hope of stirring up a mutiny against the British. They were betrayed by a bar girl named Yvette who turned out to be a double agent. Sadat was sent to prison and kicked out of the army. Rehearsal Behind Bars

Sadat later said that his 2 1/2-year jail term was one of the best periods of his life because he used the time to read and study. "The pain, suffering and contemplation were so great that I rose above time and place, pain and joy, he said. He could not have taken his outer from the military so equably.

Even as a boy he, wanted a military career. "I went home to my village," he wrote later, "and used to look at the sky and watch the stars. Thought always of stealing two of them to decorate my uniform and become an army officer."

By happy accident, he was just the right age when a treaty between Egypt and Britain in 1937 led to the opening of the military officers' academy to young men from the middle and lower classes. Sadat was accepted and in military school became the friend of the man who was to shape the course of Sadat's life and Egyptian history - Nasser.

They celebrated Nasser's 20th birthday together over a meal of lentils, chestnuts and sugar cane along with Nasser's early ideas about nationalism and revolution. Sadat remained a Nasser loyalist through the revolution and the years of Nasser's presidency, though Naser never gave him any rally critical positions.

Little remains of Nasserism in Egypt now, Sadat having dismantled it, but Sadat clings to his military background. Observers at the annual military parade on Oct. 6, the anniversary of the 1973 war, gasped last year when Sadat and his top assistants appeared in brand new, specially designed fied marshal uniforms, complete with jodphurs, knoww boots and spurs. Sadat wore that outfit again at this year's parade and added a new touch - he reviewed the troops in an armored car that had been fitted with a special turret so he could stand up in it. It looked like a tugboat.

After World War II, out of the Army, Sadat had a variety of odd jobs that left him almost broke but gave him some rapport with Egypt's urban masses. During an illegal strike by transport workers last year, observers were suprised to discove that Sadat was a member of the drivers' union. Egypt's Other Sphinx

But now he and his half-English second wife have learned to live well in their many houses and their elegant wardrobes. Nobody was fooled by the "man of the people" show Sadat put on a year ago when he stopped his car near the Suez Canal and gave a ride to a peasant and his four children. Sadat's own daughters have married into some of Egypt's riches families.

Sadat, after his years of obscurity likes hobnobbing with the famous and powerful. He told of Khrushchev, rode in a motorcade with Nixon, entertained Giscard D'Estaing. And he enjoys the immense stir he has created in world affairs.

But with the possible exception when something big is coming, few of his wife, who says he can feel it can claim to know where Sadat is really going. It may be, as some wits suggested, that when Sadat went out recently to look at the Sphinz at the request of a photographer, it represented a meeting of liek minds.