Advertisement
harsh7i

PrintRandomWord.py

Jun 20th, 2022 (edited)
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. import random
  2.  
  3. file=open('wordlist.md','r')
  4. readfile=file.read()
  5. words=list(map(str,readfile.split()))
  6. random_word=random.choice(words)
  7.  
  8. words.remove(random_word)
  9. #words.append('nano')
  10.  
  11. file_add=open('wordlist.md','w')
  12. for item in words:
  13.     file_add.write(item+'\n')
  14. print(words)
  15.  
  16. dictionary={
  17.     "after":"movie",
  18.     "star":"galaxy",
  19.     "earth":"planet"
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement