title: How to give the user pre-filled input to edit and then approve? Python
body: <p>In my script, I want to ask the user for input on the correct or incorrect spelling of a sentence (i) and allow the user to make corrections if necessary. I am running this simply in Jupyter Notebook on a Mac. (We do not know in advance which sentence contains errors and which do not.) This is quite straightforward to do. However, I want to give the user the sentence <em>i</em> as an editable input at the prompt. I have tried to achieve this by adding a variable to the 'input' line in the script, but that does not work. I cannot find a positive answer to this question. Perhaps somebody knows if it is possible or impossible?</p>
  
  <p>Here is the script.</p>
  
  <pre><code>    i = "Today, John toak the bus to school."
      print(i)
      print(f"Is this sentence spelled correctly? No = 0, Yes = 1")
      choice = input("&gt; ")
      if choice == "1":
          return i
      else choice == "0":
          spelling = input("&gt; ", i) # this does not work. Is there a way?
          return spelling
  </code></pre>
  
  <p>Suppose the script gives the user the following line:</p>
  
  <pre><code>John wend to school by bus today.
  Is this sentence spelled correctly? No = 0, Yes = 1
  </code></pre>
  
  <p>If the user selects 0 (=No), I want the sentence to already appear at the prompt so that the user can edit it (just change 'wend' to 'went' and hit 'enter') rather than having to type the entire sentence again (with the risk of new mistakes):</p>
  
  <pre><code> |-----------------------------------------|
   | &gt; John wend to school by bus today.     |
   |-----------------------------------------|
  </code></pre>
  
  <p>Does anyone know if this is possible and, if so, how?</p>