Myrtle Kelso Hansberry, 71, a retired teacher in the D.C. public school system and a longtime resident of Washington, died of cardiac arrest Wednesday at the Lynn House nursing home in Alexandria.

Mrs. Hansberry was born in Meridian, Miss., and grew up in Chicago. She earned a bachelor's degree in modern languages at the University of Chicago and did graduate work there in social work.

She was a social worker in the Chicago area until 1937, when she married William Leo Hansberry, a professor of history at Howard University who specialized in Africa. Mrs. Hansberry began teaching in the D.C. school system about 1957 and was a French teacher at Alice Deal Junior High School at the time of her retirement about 1975.

Mrs. Hansberry accompained her husband on several trips abroad. They spent the year following their marriage in Oxford, England, where Prof. Hansberry translated source materials at the university there. The Hansberrys spent 1953 in Egypt on a Fulbright Fellowship that had been awarded to Prof. Hansberry. In 1960, they went to Nigeria in connection with the opening of the Hansberry Institute of African Studies, a part of the University of Nigeria. In 1964, they visited Ethiopia, where Prof. Hansberry received the first Emperor Haile Selassie Trust Award. Prof. Hansberry died in 1965.

As a parent in Washington, Mrs. Hansberry was active in raising funds for legal fees in civil rights cases. She also appeared before congressional committees in behalf of higher appropriations for the black section of the city's school system, which was segregated until 1954.

Mrs. Hansberry was a member of the American Association of Teachers of French and of the Seventh Church of Christ, Scientist, in Washington.

Survivors include two daughters, Gail A. Hansberry, of New York City, and Kay Hansberry of Washington, and her mother, Mamie A. Kelso, also of Washington.