But only if you know what sin/evil is.
They did not have to know sin or evil---to sin is to go against God. He said do not eat---they did. They knew the consequences, He said they would die. A baby need not know why they should not play with matches---they just need to know what the word "NO!" means---and they did. It was pretty simple---do not eat of it. God did not even have to tell them what would happen if they did it, a simple do not eat of it would have sufficed. It is obvious Eve knew exactly what was meant by it for she repeated it to the snake.
A judge will tell you that ignorance is no excuse. Ignorance of the law will still get you in trouble. The penalty may not be as harsh--but they were not ignorant--they were told not to. Ignorance would have been if God had not told them not to eat of it.
And God made provision for sins from ignorance with the blood sacrifice.
Lev 4:27 And if any one of the common people sin through ignorance, while he doeth somewhat against any of the commandments of the LORD concerning things which ought not to be done, and be guilty;
Lev 4:28 Or if his sin, which he hath sinned, come to his knowledge: then he shall bring his offering, a kid of the goats, a female without blemish, for his sin which he hath sinned.
Lev 5:15 If a soul commit a trespass, and sin through ignorance, in the holy things of the LORD; then he shall bring for his trespass unto the LORD a ram without blemish out of the flocks, with thy estimation by shekels of silver, after the shekel of the sanctuary, for a trespass offering: