title: Using python to read text files and answer questions
body: <p>I have this file animallog1.txt which contains information that i would like to use to answer questions using python. How would i import the file to python, which would latter be used
  I tried</p>
  
  <pre><code>with open('animallog1.txt', 'r') as myfile
  </code></pre>
  
  <p>but this is not working and just outputs no such file or directory even though i am pretty sure it exists</p>
  
  <pre><code>animal_names, dates, locations = [], [], []
  
  with open('animallog1.txt', 'r') as myfile:
      for line in myfile:
          animal_name, date, location = line.strip().split(':')
          animal_names.append(animal_name)
          dates.append(date)
          locations.append(location)
  
  
   print(animal_names)
   print(dates)
   print(locations)
  </code></pre>
  
  <p>so this is the code that i have. animallog1.txt is the name of the file that i want to use.</p>
  
  <p>However my output is</p>
  
  <pre><code>Traceback (most recent call last):
    File "None", line 3, in &lt;module&gt;
  builtins.FileNotFoundError: [Errno 2] No such file or directory: 'animallog1.txt'
  </code></pre>
  
  <p>how can i fix this?</p>