What is a comment?
Logout: Do not participate in execution
Explanation Code: Someone is used to explaining the code on the edge, suggesting that it be put on top.
1 ) A single line comment begins with #
# Requirement 12: Keyboard input positive integer n, to find the sum of N and its reverse order and output for example: 123 reverse order 321 output 123+321=?
Single-line uncomment: Ctrl +/
2 multiple lines of comment, which tells you the function of the module, has better readability, can use multiple # numbers, and "and" ":
Such as:
"""
# Requirement 12: Keyboard input positive integer n, to find the sum of N and its reverse order and output for example: 123 reverse order 321 output 123+321=?
num=input (" Please enter a number:")
New_num= ""
I=len (num)
Whilei>=1:
NEW_NUM+=NUM[I-1]
I-=1
Print ("%d+%d=%d"% (int (num), int (new_num), int (num) +int (new_num)))
"""
Multi-line logout, select multiple lines of code and CTRL +/to cancel multiple lines
3 ) Other
#-*-coding:utf-8-*-tells the type of code used
#!/usr/bin/python3 code written under Linux, Windows does not have to write
#! /d:/python/python.exe write code in Windows, can not write
Python: Comments