1. Integer
Unlike other languages, two multiplication sign (* *) represent a exponentiation operation. The front represents the base, and the back represents the exponent.
2. Floating point number
It is possible that the number of decimal digits is indeterminate and needs attention
3. Use STR () to avoid errors
You can avoid type errors when you output a string.
4. Notes
In Python, annotations are identified with a pound sign (#). The contents behind the pound sign are ignored by the Python interpreter.
The main purpose of writing comments is to explain what the code does and how it is done. During the development project, you
Know how to work together, but after a while, there are some details you may not remember. Of course, you can always pass the research
The code to determine how each part works, but by writing annotations, the solution is outlined in clear natural language,
Can save a lot of time.
To be a professional programmer or to work with other programmers, you must write meaningful comments. Currently, most software is
Co-authored, the writer may be a multi-employee of the same company, or a large number of people committed to the same open source project.
Well-trained programmers want the code to contain comments, so you'd better add descriptive comments to your program from now on.
As a novice, one of the most rewarding habits is to write clear, concise comments in your code.
If you are unsure whether you want to write a comment, ask yourself if you have considered more than one solution before you find a reasonable solution
Case. If the answer is yes, write a comment to explain your solution. Instead of going back to adding comments, delete
It is much easier to do so than to make redundant comments. From now on, the example in this book will use annotations to illustrate how the code works.
Number of Python