Order of lyricist and composer in sheet music

I have electronic-keyboard sheet music which sometimes distinctly lists the composer of the words and that of the music; sometimes it’s the same person; sometimes it says “By” or “Words and Music by” and gives two or more names. Is it possible to make a distinction between lyricist and composer of music, from such a desgination?
A subtopic: I have heard that John Lennon actually did not compose any part of the Beatles’ songs for which he is given credit in the sheet music; supposedly Paul McCartney wrote words and music all by hiumself. Is this correct?

Well, all the famous lyricist-composer duos I can think of put the lyricist’s name first: Gilbert and Sullivan, Rodgers and Hammerstein, Lerner and Loewe… But I don’t know if there’s a set way of doing it. In Comp 421 they told us to put the lyricist’s name on the left side of the page and the composer’s on the right…

In Entertainment Management class (going on 20 years ago now), we were told that these things are left to the individuals involved, their agents, and their lawyers. Royalties are given to all persons listed as authors, but I don’t recall any specific stipulations for order or attribution of lyricist/composer.

As for Lennon and McCartney – all four Beatles have given numerous interviews wherein they discuss who wrote what. George Martin, their producer, has done the same. Hunter Davies, their biographer, actually sat in on some writing sessions and reported them in his book. Numerous other observers have also chimed in. The unanimous conclusion: both John and Paul wrote both words and music. In the early years they tended to do so fairly collaboratively. But by the Help! album (1965), John was writing both words and music to his songs, and Paul was writing both words and music to his songs. During rehearsals and recording they would all make changes and refinements, but the primary author was just that – the guy who wrote most or all of it.

– Beruang