Les commentaires en Python

1 - Qu'est-ce qu'un commentaire en Python?

Les langages de programmation fournissent une méthode pour l'insertion de commentaires au seins du code afin de fournir des informations supplémentaire. Un commentaire n'est autre qu'un texte qui sera ignoré lors de l'exécution du programme. Les commentaires peuvent être utilisés pour expliquer une partie compliquée d'un programme, ou pour mettre des indications dans le code, comme le code source, la version du langage ou script...

2 - Commentaire sur une seule ligne





En Python, nous insérons un commentaire sur une seule ligne avec le caractère # (un signe dièse).

Syntaxe

Exemple

3 - Commentaire sur  plusieurs lignes

Si nous voulons insérer un commentaire sur plusieurs lignes en Python, nous utilisons le symbole des guillemets doubles

Syntaxe

Syntaxe




 

Younes Derfoufi
CRMEF OUJDA

14 thoughts on “Les commentaires en Python

  1. Très bel article. Je suis juste arrivé sur votre blog par hasard!
    et je voulais dire que j’ai vraiment apprécié parcourir vos articles de blog.
    En tout cas je m’abonnerai à votre flux rss et j’espère que vous m’écrirez à nouveau très bientôt !

  2. Après avoir lu ceci, j’ai trouvé cela extrêmement instructif.
    J’apprécie que vous ayez pris le temps et les efforts pour mettre ce court article
    ensemble. Je me retrouve encore une fois à dépenser beaucoup
    trop de temps à lire et à poster des commentaires. Mais alors quoi,
    ça valait quand même le coup !

  3. Today, I went to the beach front with my children.
    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 put 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 entirely off topic but I had to tell someone!

  4. Hmm it seems like your site ate my first comment (it was super long) so I guess I’ll just sum it up what I wrote and say, I’m
    thoroughly enjoying your blog. I as well am an aspiring blog writer but I’m still new to
    the whole thing. Do you have any helpful hints
    for newbie blog writers? I’d genuinely appreciate it.

    My web blog :: เว็บตรง ไม่ผ่านเอเย่นต์

  5. A person essentially assist to make critically articles I’d state.
    That is the very first time I frequented your website page and to this
    point? I amazed with the research you made to create this actual publish extraordinary.
    Excellent task!

  6. Ping : Google
  7. You really make it seem so easy with your presentation but
    I find this matter to be really one thing which I feel I’d by no means understand.
    It seems too complex and extremely huge for me. I am taking a look ahead
    on your next put up, I will try to get the cling of it!

Leave a Reply

Your email address will not be published. Required fields are marked *