Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

multiline comment in python

# This a comment
#Or This
#For a comment written in more than a line
#You just add triple quotes without assigning it a variable or putting it in a
#print statement
'''
Like This
But only for Python
As far as i know
'''
Comment

muliline comment in pyhton

"""
Use * for multiplication of a number
The * is a multiplication operator in Python
To print the value, use the print() function
"""
Comment

multiline comment in python

# Python is a language that doesn't support multiline comments
# In languages like JS, single line comments have // in the beginning
# and multiline comments have /* in the beginning
# and */ in the end
# the pound symbol in front of these five lines is the python equivalent of //
print("But there is a workaround!!!")
"""
In python, multiline string is written with 3 double or single quotes, 
and the characters in between are treated as an entire string
but, if this string isn't assigned to a variable, python doesnt give any error
It instead ignores the string, similar to the behaviour it would have 
towards a comment. 
BUT!!!!!
If this is string is put just after defining a function, it is treated as a 
docstring, or the documentation string of that function. So, it does have a 
meaning and is not exactly ignored by Python
"""
def someFUnc():
  """
  Python will treat this as a docstring
  """
  pass

print(someFUnc.__doc__)

# OUTPUT:
#   Python will treat this as a docstring
Comment

PREVIOUS NEXT
Code Example
Python :: len(sys.argv) == 2 
Python :: how to find avrage python 
Python :: skimage local threshold 
Python :: root value of a column pandas 
Python :: jupyter notebook spark 
Python :: def python 
Python :: python string generator 
Python :: pytest temp directory 
Python :: multiple plot in one figure python 
Python :: python heatmap 
Python :: NumPy resize Example 
Python :: how to specify variable type in python 
Python :: python write byte 
Python :: print(int()) 
Python :: remove from list if not maches in list 
Python :: pack tkinter 
Python :: display pandas dataframe with border 
Python :: stack error: command failed: import sys; print "%s.%s.%s" % sys.version_info[:3]; 
Python :: open file with python 
Python :: #finding the similarity among two sets 
Python :: cmd to get ip address python 
Python :: python list files in directory 
Python :: np.arrange 
Python :: comment out multiple lines in python 
Python :: python byte like to string 
Python :: how to show bar loading in python in cmd 
Python :: python get input 
Python :: python index of lowest value in list 
Python :: python staticmethod property 
Python :: how to generate random number in python 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =