Python Mastery: From Beginner to Expert
  • πŸ‘‹About this Course
  • 😎About the Instructor
  • Introduction
    • πŸ’‘What is Python?
    • 😌Why Learn Python?
    • πŸ₯°Python Installation and Setup
  • Basics Of Python Programming
    • 😨Basic Syntax
    • 😳Comments
    • πŸ˜›Variables
    • 😺Keywords and Identifiers
    • ☺️Input and Output
    • 🀲Functions
    • 😢Operators
    • ✨Flow Control
  • Python Data Types
    • πŸ˜‡Introduction
    • πŸ”’Numeric Data Types
    • 😸List
    • 😸Tuple
    • 😨Strings
    • ☺️Sets
    • ✌️Dictionary
  • Master OOP
    • πŸ’‘Introduction
    • πŸ‘Classes and Objects
    • πŸ˜‰Inheritance
    • 😘Polymorphism
    • 😽Encapsulation
    • πŸ˜…Abstraction
  • Advance Python
    • πŸ˜‹File Handling
    • 🀌Exception Handling
    • 🀀Iterators
    • πŸ₯ΈGenerators
    • 🀠Closures
    • πŸ€–Decorators
    • 😍RegEx
    • 🀯Recursion
  • Python GUI
    • πŸ˜‡Tkinter
    • πŸ₯ΆPyQt
    • 😦Kivy
  • Networking With Python
    • 😁Socket
    • πŸ₯³Requests
Powered by GitBook
On this page
  1. Basics Of Python Programming

Comments

In Python, comments are used to explain the code and make it more understandable to other programmers. Comments can be added to a single line or multiple lines of code. They are ignored by the Python interpreter during runtime and are only meant to be read by humans.

To add a single-line comment, use the hash (#) symbol followed by the comment. For example:

# This is a single-line comment

To add a multi-line comment, use triple quotes (''') to enclose the comment. For example:

'''
This is a multi-line comment.
It can span across multiple lines.
'''

It's good practice to add comments to your code, especially when working on large projects with other programmers. They can help explain what the code is doing, why it's doing it, and any potential issues or edge cases to be aware of.

PreviousBasic SyntaxNextVariables

Last updated 2 years ago

😳