Number of Python

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.