Turning a list into a string to then finding the location of the words in the string
<p><strong>Code: (Python 3.5.2)</strong></p>

<pre><code>import time
import sys


def Word_Position_Finder():
    Chosen_Sentence = input("Make a simple sentence: ")
    Sentence_List = Chosen_Sentence.split()
    if len(Chosen_Sentence) == 0:
        print("Your Sentence has no words! Restarting Program.")
        time.sleep(1)
        Restarting_Program()        
    print(Sentence_List)
    time.sleep(1)
    Users_Choice = input("Do you want to make a new sentence (press 1) or keep current sentence (press 2): ")
    if Users_Choice == "1":
        print("Restarting Program.")
        time.sleep(1)
        Restarting_Program()           
    elif Users_Choice == "2":
        print(Chosen_Sentence + ". This is your sentence.")
        Chosen_Word = input("Which word in your sentence do you want to find the position of? ")
        for index, word in enumerate(Sentence_List):
            if(word == Chosen_Word):
                print("Your word appears in the number " + str(index) + " slot of this sentence")  
        elif Chosen_Word not in Users_Sentence:
            print("That word isn't in the sentence")
            Choose_To_Restart()
    else:
        print("Restarting Program.")
        time.sleep(1)
        Restarting_Program()

def Choose_To_Restart():
    time.sleep(1)
    loop = input("Want to try again, Y/N?")
    if loop.upper() == "Y" or loop.upper() == "YES":
        print("Restarting Program")
        time.sleep(1)
        Restarting_Program()
    elif loop.upper() == "N" or loop.upper() == "NO":
        print("Ending Program")
        time.sleep(1)
        sys.exit("Program Ended")  
    else:
        print("That isn't a valid answer, going to assume you said no.")
        time.sleep(1)
        sys.exit("Program Ended")


def Restarting_Program():
    Word_Position_Finder()


Word_Position_Finder()
</code></pre>

<p><strong>Question:</strong></p>

<ul>
<li>I'm having a problem fulling turning a users list into a string to then be printed and having the problem after that printing the location of the users chosen words. The code which needs help with is between the "This code needs fixing:" line; which obviously aren't in the actual code.</li>
</ul>

<p>I'm writing code which a user inputs a sentence, the sentence is then turned into a list and shown to the user to decide if he/she is happy with it. After that (the bit I am having trouble with) the user chooses a word in their sentence that they want to know the location of and I must print the locations of the chosen word(s). I decided to fully show all my code so anyone reading could help me improve (since I do enjoy coding but I only do it for school tasks) the overall code.</p>

<p>How's this?</p>

<pre><code>    words_list = Users_Sentence.split()
    for index, word in enumerate(words_list):
        if(word == Chosen_Word):
            print("Your word appears in the number " + str(index) + " slot of this sentence")
</code></pre>

<p>Here's some console output to show what split and enumerate are doing:</p>

<pre><code>    &gt;&gt;&gt; a="This is an example sentence"
    &gt;&gt;&gt; words = a.split()
    &gt;&gt;&gt; print(words)
    ['This', 'is', 'an', 'example', 'sentence']
    &gt;&gt;&gt; for i, word in enumerate(words):
    ...     print(i)
    ...     print(word)
    ...
    0
   This
   1
   is
   2
   an
   3
   example
   4
   sentence
</code></pre>

python