Python Learning Record

Source: Internet
Author: User
Basic use of Python

Add #!/usr/bin/env python to each pythonw file to specify the interpreter for the Python file, otherwise executing the. py file will make an error.

1. New Python file (under Linux)

Vim hello.py

2. Methods of annotations in Python files

#: Comment One line

"' Comment inside ': Multiline comment

3, the basic type of data

int: integer value -2**31-1~2**31-1 are all shaping data. The 2**31-1 is executed directly in the code, and the output value is also a long integer, because the 2**31 has been judged to be a long integer between minus 1.

Long: The integer value can be infinitely large, but its value does not contain the number of int integral type

float: floating-point digits with decimal points

Boolean value: True or False 0 or 1

String: For example "Hello word"

Python Learning Record

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.