It is one of the best known and most successful musical collaborations in history. Between 1962 and 1969, the partnership published approximately 180 jointly credited songs, of which the vast majority were recorded by the Beatles, forming the bulk of their catalogue.
Unlike many songwriting partnerships that comprise separate lyricist and composer, both Lennon and McCartney wrote words and music. Sometimes, especially early on, they would collaborate extensively when writing songs, working “nose to nose and eyeball to eyeball”. Later, it became more common for one of the two credited authors to write all or most of a song with limited input from the other.
“He provided a lightness, an optimism, while I would always go for the sadness, the discords, the bluesy notes”, John Lennon explained .(Wikipedia)
By an agreement made before the Beatles became famous, Lennon and McCartney were credited equally with songs that either one of them wrote while their partnership lasted. Lennon–McCartney compositions have been the subject of countless cover versions. According to Guinness World Records, “Yesterday” has been recorded by more artists than any other song.