Adding \n only to Y and not X

I am working on the Dinosaur programming assignment of Week 1 and was wondering why we only add the newline character to Y and not X as well. Also why would we need to different parameters X and Y if we can obtain Y from X? Thank you!

We are training the model to generate some new Y values later.