samedi 21 mars 2020

How to randomly generate words from a paragraph of text in python?

I have a text file of about 1000 words and I want to write a script that prints 3 random words from that text.

I want a way to avoid it generating generic words like 'and' 'then' etc. so perhaps adding a function whereby the word must be 5+ characters long.

I want to use python but I am starting from scratch and don't know where to start!

Thank you




Aucun commentaire:

Enregistrer un commentaire