Created
October 15, 2016 07:55
-
-
Save Parassharmaa/584038fee230eeeddbfd34bc7a795151 to your computer and use it in GitHub Desktop.
Generate random word.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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