-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_1Comment.py
More file actions
49 lines (40 loc) ยท 1.36 KB
/
Python_1Comment.py
File metadata and controls
49 lines (40 loc) ยท 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#COMMENTS IN PYTHON
#To Understand Code
#Can explain Code
#Organize our code
#Prevent from Errors and Bugs
num = 51 #Creates a variable and assign integer data-type 1001
square =num * num #Apply the formula to find square
print(square) #Print the result
#Types of Comments
# 1.Single-Line Comments [#]
#๐To Explain and Test
#๐Can write anywhere
#๐Can write in the same line
#๐To Explain the code.
#๐To clear logic, variables and functions can be described.
#๐To test any line of code. It can also affect the code
"""
2.Multi-Line Comments
๐Can comment Multiple lines.
๐Interpreters Ignore the comments.
๐To Document OR Inform about the code.
๐Can Write in the Beginning.
๐To Understand Code.
๐Can't write in the end.
๐Can write in between code.
๐๐Can tell the Purpose, Date, Author, Version, Dependencies can told.
๐๐Can used to describe the Functions,Classes modules and packages.
๐๐To give long description that cannot be explained in one single line.
"""
"""
Comments should be simple and clear
Comments should be more consistant
Comments should be updated
Comments should be informative
Comments should be Grammatically Correct
#Importing the constant pi from โ
#the โ
#module โ
#Importing the constant pi the module โ
โ
โ
"""