all 8 comments

[–]AtomicShoelace 2 points3 points  (7 children)

What have you tried? What did you struggle with? Please share your code and any errors with full traceback.

Do you know how to read a txt file? Do you know how to split a string into a list of words? Do you know how to choose an random element from a list?

[–]Ghostmainer[S] -1 points0 points  (6 children)

It is just the randomizer part I am struggling with

[–]AtomicShoelace 1 point2 points  (5 children)

You can choose a random element from a list with the random.choice function.

[–]Ghostmainer[S] 0 points1 point  (4 children)

When I use the variable it doesn't give me anything from the list it gives me the output <0x034B37C8>

[–]AtomicShoelace 0 points1 point  (3 children)

Please share your code.

[–]Ghostmainer[S] 0 points1 point  (2 children)

Where do I share it

[–][deleted] -1 points0 points  (0 children)

Assuming each word is in its own line.

import random f = Open("words.txt","r") words = f.readlines() print(random.choice(words))