1~20171217-103148.py 686 B

1234567891011121314151617181920212223242526272829303132
  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. nouveau_mot= prefixe1+mot
  19. print(nouveau_mot)
  20. #séparer chaque mot
  21. #choix d'un prefixe parmis le stack de prefixe
  22. #indiquer au prefixe qu'il precede le mot