Python Learning Diary

Source: Internet
Author: User

Python and java,.net,php web platform interaction is best used in Web communication, do not use Jypython,ironpython, the advantage is to be able to keep the program modular, decoupling good

Python allows you to use the "..." method to represent multiple lines of code:

Print (R"'Hello,... lisa! " " ) hello,lisa! >>>

Print ("'line1 ... line2 ... line3") Line1line2line3

You can also use R ' xxx ' to indicate that XXX internally does not do any escape operation, which is beneficial for the native output content.

Print (R'\\\t\\') # Output \\\t\\

Data types that Python can handle directly:

Integer, floating-point number, String, Boolean (True,false),

There is also a list (similar array), Dict (similar to JS object literal)

Constant: PI

Two types of division:

/: Automatic use of floating-point numbers, such as 10/3=3.33333 9/3=3.0

: Rounding 10//3= 3

%: 10%3=1

Attention:

Python supports a variety of data types, and in the computer, any data can be considered as an "object", and variables are used in the program to point to these data objects, the variable assignment is actually the data and variables associated with it "

Python has no size limit for integers

Python string encoding commonly used functions:

Ord (' x ') returns the Unicode encoding corresponding to the X character, and Chr (' Hexcode ') returns the Unicode encoding corresponding to the grandfather

>>> Ord ('A')65>>> ord (' Middle ') 20013>>> chr'B'>>> chr (25991)  ' wen '

Python Learning Diary

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.