This topic comes up on a regular basis so I thought I'd address it.
Often on walks puppies will "attack" your pants, ankles, feet or leash. Why do they do this? Because they are puppies and it's fun and you are a moving target, and you probably squeal :)  It's a very normal thing for a puppy to do.

There are a few ways to deal with this. First and foremost is to not yell at the puppy for doing this as you will only be contributing to an already aroused puppy.
If you are on a walk, stop walking. Don't move forward again until the pup has stopped biting. If you can get a couple of steps without biting, praise and reward - give attention when you notice the good not the bad. Part of the reason the behaviour continues is because the puppy gets reinforced by our reaction. It turns into a fun game of attention. 

One of the reasons puppies like to bite the leash is because we humans turn it into a tug toy by pulling back on it. 
If your puppy likes to bite the leash, consider hooking up 2 leashes. When he begins to bite the one you are holding, drop it and pick up the other one. That prevents you from making a fun game out of it!

Reinforce polite walking by praising and rewarding with a yummy tidbit when the leash is slack, not tight.
With pups it's not important that they walk perfectly, just walk without pulling you down the street, or biting your ankles :)

It's also a good idea to have a floppy toy with you in your back pocket that you can bring out to use as a redirect for biting or prevention (offer at the first sign of arousal). 

Do not jerk the leash to get your pup to stop biting. Do not grab his face and get physical. You will teach him to hate your hands and over arouse him further. More importantly, it doesn’t teach him what you do want.

Try to be aware of when the pup is biting. Is it when he is over excited? Tired? When you first get home? On the way back home?  If that's the case then plan ahead and don't take the pup for a walk until you've played a bit in the house or backyard and burned off some puppy steam. If he is already over stimulated, then wait until he's settled down before going out to walk. If it happens on the way back, be ready with a floppy toy or be prepared to stop walking and take your time getting back.

Make sure when you are getting ready for your walk you aren't getting the pup over aroused by making a big deal about going out by saying " ohhh, do you want to go for a walk??? " in a high, excited voice. That will set him up to be over aroused before you even walk out the door. Just get ready, get the leash and go out - keep it low key. 

Dogs are experts at recognizing patterns of behaviour. He will know you are preparing for a walk long before you even think of asking; no need to say anything :)

Remember that everything outside is new to the pup and it can be very overwhelming. Be patient and don't force the pup to walk if he doesn't want to. Spend time just hanging around outside.

If you need to get somewhere quickly, pick him up and walk to where you want to go, then put him down.