title: Printing out elements of List in Prolog
body: <p>I've got a list, X, that contains three elements; ID, Name, and Grade. All taken from user input </p>
  
  <pre><code>read_student_info([A, B, C]),
  nl, nl, menu([[A, B, C] | X]).
  
  read_student_info([A, B, C]) :-
    write('\tStudent ID: '),
    read(A),
    write('\tStudent Name: '),
    read(B),
    write('\tStudent Grade: '),
    read(C).
  </code></pre>
  
  <p>Now, I want to display the elements from the list. So if I have a student whose ID = 3, Name = Tom, Grade = 78. That's what I'd like to print out. The current function I've been fooling around with is this:</p>
  
  <pre><code>show_records(X) :-
    X = [A | B],
    A = [C | D],
    id = write(C),
    name = format("~s", [B]),
    grade = write(D),
    show_records(B).
  </code></pre>
  
  <p>However I'll be the first to admit I have almost no clue what I'm doing. Any help would be very appreciated!</p>