pls respond

Quick question
say if i get a property for 40k from the seller put it under contract .

could i assign it for a higher price like 50k 60k
if the property was worth like 90k
and pocket the 10-20k ?
That's how i thought it was ?
But after reading the book I'm now confused
???