AS THESE THINGS GO, the resignation of Giovanni Leone as president of Italy was rather sudden. In a similar American case, still fresh in memory, it took more than two years of rising scandal, court action, investigations and hearings to force an incumbent president to resign. Mr. Leone's position was not so powerful as Mr. Nixon's, but neither was the public pressure on him so intense. Ever since the Lockheed affair in early 1976, Mr. Leone had been up to his ears in accusations of financial corruption. Having brazened it out for more than two years, he appeared perfectly capable of brazening it out for the remaining six months of his term. But last week, after a series of magazine articles opening further charges, he unexpectedly stepped down. Why?

The explanation lies, evidently, in the uneasy partnership and rivalry between Italy's two biggest political parties. The Christian Democrats run the government, but they do it with support and cooperation of the Communists. The Communists' intention is to ease themselves into Cabinet offices by such gradual stages that no one will be frightened. That strategy is inevitably generating great strain within the party, as the radicals and reformers assail the leadership for its obedient assistance to a decidedly conservative Christian Democratic administration.

The local elections last month greatly increased that strain. Perhaps it was a reaction to the murder of Aldo Moro a few days earlier, but the Communists suffered a sharp setback. The party decided that it requires a more aggressive posture. It couldn't move to the left ideologically without alienating the middle-class voters whom it is patiently courting. The obvious solution was to return to the emphasis on honest, efficent administration, on which much of the Communists' success over the years has rested. When the magazine articles began going into the tangled financial affairs of Mr. Leone, who is a Christian Democrat, the Communists seized their opportunity and called on him to resign. That gave the Christian Democratic leadership a choice between defending corruption or letting Mr. Leone go. With dry eyes, they cut their losses - and Mr. Leone went.

Since the office of president is largely ceremonial in Italy, it will not matter vastly who replaces him. But this incident may lead to parliamentary elections sooner than either of the big parties expected or wanted. Italian law prohibits elections in the last six months of a president's term, and the parties were counting on that technically to get them safely through the rest of this year. Neither of them is eager to face the voters just now. Neither is entirely sure of the public reaction to the Moro kidnapping. Neither wants to pursue the issues of party financing toward which the Leone case points. But it is also true that they do not entirely control the course of Italian politics. The Leone affair leaves the alliance between conservatives and Communists a little cooler and more competitive than before - which is not necessarily a bad thing.