Solution Exercice 38: mot le plus long dans une chaine de caractères en Python
Publié le8 octobre 2019
Ecrire un programme Python qui permet de chercher le mot le plus long sur une chaine s
# -*- coding: utf-8 -*-
L = s.split()
mot = ""
for x in L:
mot = x
s = "Python est un langage de programmation orienté objet"
print("Le mot le plus long dans la chaine s est : ", motMax(s))
Ce qui affiche à l’exécution:
Le mot le plus long dans la chaine s est : programmation
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.