1# this is a comment
2# Python ignores comments,
3something = 1 # and you can place them after any line of code
4
5"""If you don't want to write a comments using hashtags,
6you can put them in a multi-line comment block.
7However, if you put hashtags in strings, they do not
8create comments.
9"""
10# comments serve as notes to the programmers
11# you can write whatever you want in comments
1# this is a single line comment, python ignores these
2foo = "bar" # can be placed after code
3
4"""
5python doesnt have multiline comments
6so multiline strings do the tricks
7
8this works because python ignores string literals that arentassigned to a varaible
9"""
10
11# comments can be used as notes for the dude editing the script
1# Numpy-style python comments for functions
2def foo(param_1=True):
3 """Example function.
4
5 Parameters
6 ----------
7 param_1 : bool, optional
8 The first parameter (default is True)
9
10 Returns
11 -------
12 num
13 a number
14 """
15 return -1
16
17
1# This is a single lined comment for Python,
2# and can be used at the end of a line of code
3
4"""
5For multi-line comments,
6use three hashtags! can not go in the end of a line of code.
7""" # make sure to close your comment!
1#This is a single line Comment
2print("Hello, World!")
3"""
4python is easy and good
5And this is a multiline comment
6"""