A 10-year-old boy accused of raping an eight-year-old girl told police about the sex education lessons he had at primary school, the Old Bailey heard.
But the detective said the boy became embarrassed when asked what "sex" was. The boy said: "I don't know what it means," according to the detective.
The 10-year-old is one of two boys who each deny two charges of rape. The other boy is now aged 11.
The alleged rape happened in west London in October 2009.
Prosecutors allege the pair took the girl to different locations looking for a secluded spot to assault her.
The boys also deny two charges of attempted rape of a child under 13.
When asked what the sex-education lessons were about, the boy replied: "How to make a baby," Detective Constable Adam Lewis said.
The boy said it involved a man and a woman - but he did not want to say any more about it, the detective added.
In a police interview, the boy said that the girl had asked him to expose himself twice that day.
The boy said he pulled his trousers and pants down for about five seconds in the stairwell of a block of flats.
He said he went with her to a field where she repeated the request, and he again exposed himself.
The boy said she then asked his friend to expose himself and asked him to assault her.
The girl allegedly said: "Let's do it."
The 10-year-old said his friend told him: "Go away if you don't want to look."
He went away and his friend came round the corner 30 seconds later, the court heard.
The trial continues.