mardi 18 février 2020

Python readlines to script from txt

I got a easy question i got txt file look like this

Hello
Bla
Hey 
Go 
No

Now i want python print or change every line like this

List =  („hello“, „bla“) 

because i want to use a list from this word for random.choice. next question is how can i let python use every word random from list but not double use from word. I want every word use only one time but random in different rotation. Its a easy question i know but i forget how its works :D i test it in different ways bit nothing helps i use python 3 and windows 7




Aucun commentaire:

Enregistrer un commentaire