Trying to make an autocompleter for words in Python (Schoolwork)
<p>I have a University assigment(So I'd like to get informative hints rather than an all-out code-bunch to copy) where we're supposed to make a program that automaticaly completes words. (Gives out suggestions based on letters written.)
The suggestions for these words are taken from a list called "alphabetical.csv", which is a separate data file, containing around 90000 different words.</p>

<p>I am a complete beginner in the Python-language and programming in general and only have vague ideas of where to start with this.  I've been thinking of making lists to be printed out to the user, suggesting all words beginning with a certain letter, and possibly the next, and the next, and so on, but I've no idea of how to implement that effectively. I've only ever done very simple while, else and if-stuff before, as well as very simple functions that concatenate inputted strings and such.
There is a skeleton which must be used with the assigment which looks like this:</p>

<pre><code>def main():
    """Initialize main loop."""
    word = ""

    while word != "q":
        word = input("Type word: ").lower()
        print("Autocompletion finished: ", autocomplete())

def autocomplete():
    """Return autocomplete suggestions."""
    pass

main()
</code></pre>

<p>We are not supposed to import anything, and the program itself is supposed to run in a terminal.</p>

<p>I'd be very grateful if anyone could get me started on this.
(Again, not looking for a straight out solution to the assigment, I'm supposed to learn something from this.)</p>

<p>You will first need to <a href="https://docs.python.org/3.6/library/functions.html?highlight=open#open" rel="nofollow">open</a> a file and to <a href="https://docs.python.org/3.6/library/io.html#io.TextIOBase.read" rel="nofollow">read</a> it.
Then you will have to search words which start with a substring, <a href="https://docs.python.org/3.6/library/stdtypes.html?highlight=str.startswith#str.startswith" rel="nofollow">str.startswith</a> could help you.
Since you apparently already know loops and the <a href="https://docs.python.org/3.6/library/functions.html?highlight=print#print" rel="nofollow">print</a> function, you should be able to do something functionnal.</p>

python autocomplete words