In this chapter, we define quandle cocycle invariants for classical knots and knotted surfaces. Details of algebraic aspects of homology and cohomology of quandles will be discussed in a later chapter, and here we limit discussions of cocycles to functions used as weights, and present useful polynomial cocycles.