Why is pregnancy 9 months, 40 weeks?

Isnt it technically 10 months then? I'm confused. Can someone explain.