title: How do I print only the first 10 lines from a csv file using Python?
body: <p>I'm new to Python and I'm wanting to print only the first 10 lines of a huge csv file. </p>
  
  <p>Here's my code so far that prints all of the lines in the csv file</p>
  
  <pre><code>import csv
  with open('titanic.csv') as csvfile:
      reader = csv.DictReader(csvfile)
      for row in reader:
          print(row['survived'], row['pclass'], row['name'], row['sex'], row['age'])
  </code></pre>