Genetic algorithms (GAs) are a class of probabilistic optimization algorithms which utilize ideas from natural genetics. In this paper, we apply the genetic algorithm to a difficult machine learning problem, viz., to learn the description of pushdown automata (PDA) to accept a context-free language (CFL), given legal and illegal sentences of the language. Previous work has involved the use of GAs in learning descriptions for finite state machines for accepting regular languages. CFLs are known to properly include regular languages, and hence, the learning problem addressed here is of a greater complexity. The ability to accept context free languages can be applied to a number of practical problems like text processing, speech recognition, etc.