An associative algebra is nothing but an odd quadratic codifferential on the tensor coalgebra of a vector space, and an A-infinity algebra is simply an arbitrary odd codifferential. Hochschild cohomology classifies the deformations of an associative algebra into an A-infinity algebra, and cyclic cohomology in the presence of an invariant inner product classifies the deformations of the associative algebra into an A-infinity algebra preserving the inner product. Similarly, a graded Lie algebra is simply a special case of an odd codifferential on the exterior coalgebra of a vector space, and an L-infinity algebra is a more general codifferential. In this paper, ordinary and cyclic cohomology of L-infinity algebras is defined, and it is shown that the cohomology of a Lie algebra (with coefficients in the adjoint representation) classifies the deformations of the Lie algebra into an L-infinity algebra. Similarly, the cyclic cohomology of a Lie algebra with an invariant inner product classifies the deformations of the Lie algebra into an L-infinity algebra which preserve the invariant inner product. The exterior coalgebra of a vector space is dual to the symmetric coalgebra of the parity reversion of the space, while the tensor coalgebra of a vector space is dual to the tensor coalgebra of its parity reversion. Using this duality, we introduce a modified bracket in the space of coderivations of the tensor and exterior coalgebras which makes it possible to treat the cohomology of an A-infinity or L-infinity as a differential graded algebra in the same manner in which the Gerstenhaber bracket is used to transform the Hochschild cochains of an associative algebra into a differential graded algebra.