pyt6~20171216-170800.py 490 B

12345678910111213141516171819
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # this programme compare a text in french and its translation in englishe and liste the common words .
  4. textFr ="j'ai fait le sport : le jogging"
  5. textEn = "I do sport : jogging "
  6. mots=textFr.split()
  7. words=textEn.split()
  8. # for each word in the line:
  9. #for mot in mots:
  10. # print the "mot"
  11. #print(mot)
  12. #for word in words:
  13. # print the "word"
  14. #print(word)
  15. for word in words:
  16. for mot in mots:
  17. if word == mot :
  18. print(word)