title: why is it possible to pass a file as a string to the open function
body: <p>Can someone help me around this logic, I have seen in other people code, they usually pass an object in string representation to a function. E.g the open file function.</p>
  
  <pre><code>txtFile = open("fruits.txt")
  print(txtFile.read())
  </code></pre>
  
  <p>Why is <code>fruits.txt</code> in quotes and when should an object of anything be in quotes when passing it into another function parameter can someone also please give me more examples when should</p>
  
  <p>I know that for example using a print function this can in a string or an object.</p>
  
  <pre><code>name = 'sam'
  print(name, 'sam')
  output &gt;&gt;&gt;&gt;&gt; sam sam.
  </code></pre>
  
  <p>The object name, when passed to the print method, isn't placed in a string format, however, the example of an open file with fruits.txt is enclosed into a string format. and if I placed the name in a string like</p>
  
  <pre><code>name = 'sam'
  print('name', 'sam')
  output &gt;&gt;&gt;&gt;&gt; name sam.
  </code></pre>