commited all contents created by participants
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# this programme compare a text in french and its translation in englishe and liste the common words .
|
||||
|
||||
textFr ="j'ai fait le sport : le jogging"
|
||||
textEn = "I do sport : jogging "
|
||||
mots=textFr.split()
|
||||
words=textEn.split()
|
||||
# for each word in the line:
|
||||
#for mot in mots:
|
||||
# print the "mot"
|
||||
#print(mot)
|
||||
#for word in words:
|
||||
# print the "word"
|
||||
#print(word)
|
||||
nb=0
|
||||
for word in words:
|
||||
|
||||
word = word.strip(" ;''?:,()!.\").”-")
|
||||
for mot in mots:
|
||||
#mot = mot.strip(" ;''?:,()!.\").”-")
|
||||
if word == mot :
|
||||
nb= nb+1
|
||||
print(word)
|
||||
print("nombres des mots identiques =" , nb)
|
||||
Reference in New Issue
Block a user