Vérification de palindromes en Python

Écrire un programme Python qui demande à l'utilisateur de saisir un mot de longueur quelconque et détermine si le mot est un palindrome ou non. (Ex. ressasser)

Python pandacodeur 1

Correction :

mot = input("Entrez un mot : ")

if mot == mot[::-1]:
    print("Le mot est un palindrome.")
else:
    print("Le mot n'est pas un palindrome.")

 

Si vous avez trouvé les exercices corrigés en  Python de Mr JoëlYk intéressants et utiles, pourquoi ne pas les partager avec d'autres personnes qui pourraient également en bénéficier ? Partagez ce lien sur les réseaux sociaux ou envoyez-le à vos amis et collègues. Vous pourriez aider quelqu'un à améliorer ses compétences en programmation ou à trouver des solutions à des problèmes complexes. N'oubliez pas que la connaissance doit être partagée pour grandir. Merci pour votre soutien et votre partage !

Contact WhatsApp : +237 658395978 | Réaliser Par Joël_Yk

Aucune note. Soyez le premier à attribuer une note !

Commentaires

  • SpinBetter

    1 SpinBetter Le 18/12/2025

    Today, I went to the beach with my kids. I found a sea shell and
    gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the
    shell to her ear and screamed. There was a hermit
    crab inside and it pinched her ear. She never wants
    to go back! LoL I know this is totally off topic but I had to tell someone!
  • 1Win

    2 1Win Le 16/12/2025

    We are a gaggle of volunteers and starting a brand new scheme in our community.
    Your web site offered us with useful info to work on. You have performed an impressive process
    and our whole community shall be thankful
    to you.

Ajouter un commentaire

Anti-spam