title: How to include an input function for an I/O file?
body: <p>Please have a look at the requirement below. Typically an input function is utilized as follows: it has a variable followed by an equal sign and then the input function with parenthesis of the wording.</p>
  
  <pre><code>name = input("what is your name?")
  </code></pre>
  
  <p>But in an I/O file, I wish to include this to an open/write/close process and in particular the write part of the process.</p>
  
  <p>Obviously, this next line of code isn't it:</p>
  
  <pre><code>outfile = open("L7_2.csv","w")
  outfile.write()
  name = outfile.write(input("What is your First Name?"))
  outfile.close()
  print("L7_2.csv created")
  </code></pre>
  
  <p>Requirements</p>
  
  <ol>
  <li><p>Write a program that will prompt the user for their
  first and last names</p></li>
  <li><p>Using the "with" method, open X7_2.txt for writing
  and then write the first name and last name to a line in the file
  in the following format: Hi (firstname)
  and the last name to the next line in the file
  in the following format: Your lastname is (lastname)</p></li>
  </ol>
  
  <p>Here is an example run...</p>
  
  <pre><code>What is your First Name? Steve
  What is your Last Name? Perry
  </code></pre>
  
  <p>X7_2.txt created</p>
  
  <pre><code>Hi Steve
  Your lastname is Perry
  </code></pre>