Is it possible to make python to randomly choose a line EXCEPT the first line of the file which is reserved for something else? Any help appreciated :)
with open(filename + '.txt') as f:
lines = f.readlines()
answer = random.choice(lines)
print(answer)
Slice the array:
answer = random.choice(lines[1:])
Este artigo é coletado da Internet.
Se houver alguma infração, entre em [email protected] Delete.
deixe-me dizer algumas palavras