Mar-10-2018, 02:51 PM
You could, for example, store each line in a list (of quotes), instead of print it.
And to choose a random one, use random module's random.choice.
As an aside, it is recommended to use a context manager when working with files (here is one of many resources on the subject).
And to choose a random one, use random module's random.choice.
As an aside, it is recommended to use a context manager when working with files (here is one of many resources on the subject).