Python: annotation, python Annotation
What is annotation?
Logout: not executed
Code explanation: Some people are used to putting the code explanation on the edge. We suggest putting it on top.
1) A single line comment starts #
#Requirement 12: enter a positive integer n on the keyboard, find the sum of n and its reverse order, and output an example: 123 Reverse Order 321 output 123 + 321 =?
Uncomment a single row: Ctrl +/
2) Multi-line comments tell you the role of this module for better readability; you can use multiple # numbers, as well as ''' and """:
For example:
"""
#Requirement 12: enter a positive integer n on the keyboard, find the sum of n and its reverse order, and output an example: 123 Reverse Order 321 output 123 + 321 =?
Num = input ("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 )))
"""
Unregister multiple lines, select multiple lines of code, and then press Ctrl +/to cancel multiple lines.
3) Other
#-*-Coding: UTF-8-*-indicates the encoding used.
#! /Usr/bin/python3 code written in Linux, not required for windows
#! /D:/python/python.exe code written in Windows.