Python

Comments and Types of comments in python

  • Comments are very important  in  writing a program.
  • Python interpreter  ignores comment.
  • In python , commenting  is indicated by ‘#’ ,It is extended till the end of the physical line.
  • Though’ #’ indicates a comment , but when it is written along with string is not considered as a comment.
  • Python supports two types of comments.
  • Single line comments
  • Multi line comments

Single line comments

  • In this type of comment, hash(#) character is followed by the information that explains the further text.
  • In case user wants to specify a single line comment, then comment must start with (#)

Multi-line comments

  • In case if user has the comments that extend to multiple lines , One way of doing this is to use ‘#’ in the beginning of each line.
  • Multi-lined comments  should be given in triple quotes.
Lakshmi Durga

Share
Published by
Lakshmi Durga

Recent Posts

Samsung TV Red Light Blinking? 4 Fixes (2026 Power Logic Hub)

User Problem Scenario: The Red Light "Panic" You press the power button on your Samsung…

5 days ago

Samsung TV Not Connecting to WiFi: 2026 Easy Fix Guide

Introduction: I Know the Feeling "We’ve all been there. You sit down to watch your…

6 days ago

Samsung TV Restarting During Diagnosis? Fix the Reboot Loop Fast

User Problem Scenario: The "Diagnosis Loop" Paradox Imagine you notice your apps are slow. You…

6 days ago

Samsung TV Optimize Now Not Working? (2026 Fix: Greyed Out, Stuck or Not Responding)

🎓 Technical Module: Memory Maintenance Logic Module: WV-OS-307 Verified 2026 👨‍🏫 Instructor: Vangari Divya (M.Tech)…

1 week ago

Samsung Smart Hub Test Failed? (2026 Fix: DNS, ISP Block & Authentication Error)

 Introduction: The Setup Paradox "There is a specific moment of frustration for every Samsung Smart…

2 weeks ago

Samsung TV Picture Test Not Working? 4 Technical Recovery Fixes

Introduction: Lab Diary & Experience "When your Samsung TV screen begins to flicker or show…

2 weeks ago