When “Weird Al” Yankovic first appeared with accordion-driven parodies of popular songs, many people saw him as a novelty act.

Thirty-five years later, he’s one of the most successful musicians of his era, and one of only three people to have a Top 40 hit in each of the last four decades. The others are Madonna and Michael Jackson.

He has also managed to make a movie and star in TV shows, including his current role as co-host and bandleader of the talk show parody “Comedy Bang! Bang!”

amNewYork spoke with Yankovic as he prepared to wrap up a two-year, 170-city tour in support of his album “Mandatory Fun,” the first No. 1 album of his career.

Were you surprised to have your first No. 1 album at this stage of your career?

Yeah. I mean having a No. 1 album was something I thought was never in the realm of possibility. Last time a comedy album hit the top of the “Billboard” charts was during the Kennedy administration.

To what do you attribute your longevity?

First and foremost, I like to surround myself with talented people. ... They’re loyal to me and I’m loyal to them. That goes for the fans as well. A lot of people who were fans in the ’80s are still fans and now they’re bringing their kids into the fold.

When did you realize you could make a career out of parodies?

Well, I think it was about a month ago. I thought this is something that seems to be working out. Maybe I’ll make a firm commitment and do this full time now.

Is there a serious answer?

If there was one point where you could say I decided to actually get serious, it was when I quit my day job. That was after my first album had been released, because when I signed my record deal they didn’t give me a big pile of money and say, “Congratulations, you’re a recording artist!“ Basically it was a draconian contract. There was no money up front. I signed it because having a record deal sounded better to me than working a minimum wage job in a mailroom. But I still had to work at that minimum wage job while I was working on the album and even after the album came out because I had to pay for the macaroni and cheese.

My job description was that I’d have to go to the post office every morning and get the mail to the company. One day, there was a copy of “Billboard” sticking out of the top of the mailbag. I opened it up and looked at the Hot 100 chart and my first single [“Ricky”] was in the Hot 100. I thought, “You know, I should probably give notice at work. I should probably do this ‘Weird Al’ thing full time.”

How do you know if a hit will make a good “Weird Al” song?

It doesn’t usually come to me spontaneously. Sometimes I’ll hear a song on the radio and think it would be a good candidate for a parody. Maybe it has a really identifiable or recognizable hook to it. Maybe the artist or band has some kind of defining characteristic or trait that would be fun to lampoon. I basically start with a short list of songs that I think lend themselves well to parody. Then I try to think of as many variations on them as possible and as many ideas based on the song as I can to see if one idea maybe is clever enough to spend time developing into a parody.

Do you have a favorite parody that you’ve done?

I get asked that a lot. It’s hard to say what the truthful answer would be. My default answer is “White & Nerdy,” because it’s my biggest selling single and also because it’s the one I had to do the least amount of research for because I’ve been living that lifestyle my whole life.