How many weeks is a baby to grow in the womb before delivery?

it takes 40 weeks for a baby to grow in a womb but if u deliver ur baby before 32 weeks then more likely u r going to have a premature baby i was pregnant and i carried my baby for 38 weeks i had a little boy he was 5lbs and 12 oz