I am unable to figure out why my code results are come out incorrectly.
As far as I can see from the photo, it seems to me that the ‘x’ in your function definition is uppercase, while the ‘x’ in the function itself is lowercase.
Note that it should be consistent, as the case matters. Either use only uppercase, or only lowercase!
The 365 Team