1~20171217-102909.py 657 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/python
  2. # this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
  3. prefixe1 = "MONO-"
  4. prefixe2 = "UNI-"
  5. prefixe3 = "ANTI-"
  6. prefixe4 = "SUB-"
  7. print (prefixe1)
  8. #intégrer une sentence
  9. #myfile = open ("which_spites.txt", 'r')
  10. #sentence = myfile.read()
  11. #myfile.close()
  12. phrase = "And that which spites me more than all these wants- He does it under name of perfect love"
  13. print("1ere réplique:", phrase)
  14. #définir la liste de mot correspondante
  15. mots = phrase.split()
  16. print(mots)
  17. for mot in mots:
  18. print(prefixe1+mot)
  19. #séparer chaque mot
  20. #choix d'un prefixe parmis le stack de prefixe
  21. #indiquer au prefixe qu'il precede le mot