I have been scripting for around two weeks, and have just learnt about reading from a file.
What I want to do is get every other entry from my original list and store it in a new list. Is this the best way to do it?
with open("test.txt",mode="r") as myfile:
File = myfile.read().splitlines()
Username = []
for i in range (len(File)):
if File.index(File[i])%2 == 0 or File.index(File[i]) == 0:
Username.append(File[i])
print(Username)
Please bear in mind that I have only studied Python for around ten hours so far - I'm quite happy that this even seemed to work.