Hi Vania - it's highly unlikely that the file was corrupt. If it was, it wouldn't have loaded. I assume he was using the shape starter file
, from Unit 1 of Data Science?
Without seeing the code, there's really no way to tell whether or not the code was correct, but I suspect there are two things that could have gone wrong:
1) In the definitions area on the left, did he have include image at the top of the file
? This line is what imports all the image functions, and without it the triangle
function would surely have been unbound. (If he was using the shapes starter file
, then he should be all set here.)
2) Had he clicked "Run"? Remember that the computer only reads the definitions area after Run is clicked, so even if your student had the image library included he would have had to click Run in order to use it. You can test this for yourself by loading the starter file, not clicking run, and then typing triangle(50, "solid", "red") into the Interactions area.
The lesson here is that things are interconnected: the libraries included on the left will impact how code behaves on the right, and even if all the code on the left looks perfect it still has to be Run to ensure the stuff on the right functions correctly. I hope this is helpful - let us know if your student gets it working!