Dans cet exercice python nous allons résourde l'exercice suivant:
Ecrire un programme Python qui permet de regrouper dans une liste les mots communs à deux fichiers textes : fichier1.txt et fichier2.txt. Nous utilisons pour cela la méthode open python pour ouvrir les fichier en mode lecture et ensuite la methode read python pour récuperer le contenu des fichiers. Et puis on applique la méthode split pour convertir le contenu récupéré en une liste python. Finalement on parcourt les deux listes avec la boucle for pour déterminer la liste des mots communs aux deux fichiers.
Laes versions du langage Python qui ont été testé pour cet exercice sont: Python 2.7.x et python 3.8 version Windows 7 , python Windows 8, Python Windows 10. Afin de béneficier d'un visionnage optimal de la vidéo, adopter le navigateur google chrome.
In this python exercise we will resourde the following exercise:
Write a Python program that allows you to group in a list the words common to two text files: file1.txt and file2.txt. We use the open python method to open the files in read mode and then the read python method to retrieve the content of the files. And then we apply the split method to convert the recovered content into a python list. Finally we browse the two lists with the for loop to determine the list of words common to the two files.
The versions of the Python language that have been tested for this exercise are: Python 2.7.x and python 3.8 Windows 7 version, Python Windows 8, Python Windows 10. In order to benefit from an optimal viewing of the video, adopt the google chrome browser.