How do I print out individual words within my list?
<p>I am trying to print each word from my list onto separate lines, however it is printing each letter onto individual lines</p>

<pre><code>Words = sentence.strip()
for word in sentence:
    print (word)
</code></pre>

<p>My full code (for anyone wondering) is:</p>

<pre><code>import csv
file = open("Task2.csv", "w")
sentence = input("Please enter a sentence: ")
Words = sentence.strip()
for word in sentence:
    print (word)
for s in Words:
    Positions = Words.index(s)+1
    file.write(str(Words) + (str(Positions) + "\n"))
file.close()
</code></pre>

<p>You  forgot to split sentence and use "Words" not "sentence" in first for loop.</p>

<pre><code>#file = open("Task2.csv", "w")
sentence = input("Please enter a sentence: ")
Words = sentence.split()
for word in Words:
    print (word)
for s in Words:
    Positions = Words.index(s)+1
    #file.write(str(Words) + (str(Positions) + "\n"))
#file.close()
</code></pre>

<p><strong>Output:</strong></p>

<pre><code>C:\Users\dinesh_pundkar\Desktop&gt;python c.py
Please enter a sentence: I am Dinesh
I
am
Dinesh

C:\Users\dinesh_pundkar\Desktop&gt;
</code></pre>

python