Skip to content

Instantly share code, notes, and snippets.

@Parassharmaa
Created October 15, 2016 07:55
Show Gist options
  • Select an option

  • Save Parassharmaa/584038fee230eeeddbfd34bc7a795151 to your computer and use it in GitHub Desktop.

Select an option

Save Parassharmaa/584038fee230eeeddbfd34bc7a795151 to your computer and use it in GitHub Desktop.
Generate random word.
import random
df = open("sowpods.txt")
x = list(map(str,df.read().split()))
n = len(x)
r = int(input("Enter Number of words:"))
for i in range(r):
rand = random.randrange(0,n)
print(str(i+1)+"." + x[rand])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment