Categories
5G Network
Agile
Amazon EC2
Android
Angular
Ansible
Arduino
Artificial Intelligence
Augmented Reality
AWS
Azure
Big Data
Blockchain
BootStrap
Cache Teachniques
Cassandra
Commercial Insurance
C#
C++
Cloud
CD
CI
Cyber Security
Data Handling
Data using R
Data Science
DBMS
Design-Pattern
DevOps
ECMAScript
Fortify
Ethical Hacking
Framework
GIT
GIT Slack
Gradle
Hadoop
HBase
HDFS
Hibernate
Hive
HTML
Image Processing
IOT
JavaScript
Java
Jenkins
Jira
JUnit
Kibana
Linux
Machine Learning
MangoDB
MVC
NGINX
Onsen UI
Oracle
PHP
Python
QTP
R Language
Regression Analysis
React JS
Robotic
Salesforce
SAP
Selenium
Service Discovery
Service Now
SOAP UI
Spark SQL
Testing
TOGAF
Research Method
Virtual Reality
Vue.js
Home
Recent Q&A
Feedback
Ask a Question
What are Python Comments?
Home
>
Python
>
What are Python Comments?
Dec 12, 2019
in
Python
Q: Python Comments
#python-comments
1
Answer
0
votes
Dec 12, 2019
Comments in Python can be used to explain any program code. It can also be used to hide the code as well.
Comments are the most helpful stuff of any program. It enables us to understand the way, a program works. In python, any statement written along with # symbol is known as a comment. The interpreter does not interpret the comment.
Comment is not a part of the program, but it enhances the interactivity of the program and makes the program readable.
Python supports two types of comments:
1) Single Line Comment:
In case user wants to specify a single line comment, then comment must start with ?#?
Eg:
# This is single line comment.
print "Hello Python"
Output:
Hello Python
2) Multi Line Comment:
Multi lined comment can be given inside triple quotes.
eg:
''''' This
Is
Multipline comment'''
eg:
#single line comment
print "Hello Python"
'''''This is
multiline comment'''
Output:
Hello Python
Click here to read more about Python
Click here to read more about Insurance
Facebook
Twitter
LinkedIn
Related questions
0
votes
Q: Can we make multi-line comments in Python?
May 17, 2020
in
Python
#python-multi-line-comments
#multi-line-comments
0
votes
Q: What are the Comments in C++?
Jun 9, 2020
in
C Plus Plus
#c
-comments
#comments-in-c-plus-plus
0
votes
Q: How are comments used in XML?
Sep 18, 2020
in
XML
#comments-in-xml
#xml-comments
0
votes
Q: Are multi-line comments supported in Hive?
Jun 7, 2020
in
Hive
#hive-multi-line-comments
#multiline-comments
0
votes
Q: Multiline comments in Gradle build files are included using _____ .
May 27, 2019
in
Gradle
#java
#jenkins
#gradle
#github
#eclipse
#scala
#maven
#hibernate
#groovy
0
votes
Q: What are Python descriptors?
Jan 16
in
Python
#python-descriptors
...