X isn’t defined in your code, but we expected it to be Y type

  • Last updated on July 7, 2023 at 9:09 PM

This error message is usually produced by our system when it cannot find an expected variable name in your code. For example, let’s say instead of avg_rating, you have typed avg_ratings. It will generate the above error message. However, you may also be getting this error because of a platform issue like the answer-checking system failing to load correctly.

Troubleshooting

The first step is to use the Explain Code button. This option will consider your code and the answer, and then guide you to the correct solution. (You may also check the answer with the Get Help dropdown.)

If you are still having trouble, please follow these steps.