You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

21 lines
308 B

  1. import random
  2. def choisir_mot_au_hasard():
  3. fichier = open("mots.txt")
  4. contenu = fichier.read()
  5. fichier.close()
  6. mots = contenu.splitlines()
  7. n = len(mots)
  8. index = random.randint(0, n - 1)
  9. return mots[index]
  10. def main():
  11. mot = choisir_mot_au_hasard()
  12. print(mot)
  13. main()