I am currently completely new to python and trying to build a simple hangman game. I created a .txt file with all the sample words and imported it to python. When printing them out however they all have this format: ['exampleword\n'], ['exampleword2\n'] I however want to get rid of the \n ending. I tried most of the suggestions from this thread: How to remove '\n' from end of strings inside a list?, but they didn't work.
woerter = open("woerter.txt", "r")
wortliste = [line.split("\t") for line in woerter.readlines()]
print(wortliste)
I have python 3.8.2. installed, any help is greatly appreciated :)