Python Learning Notes

Source: Internet
Author: User

First, a new knowledge of Python

Python is a completely object-oriented language, with its elegant, affinity features are many program developers love. At the same time, it is an open source explanatory language and dynamic language. Has a good scalability.

Starting from Hello World:

When we learn most computer languages, we try to say hello to the world in the first language. When the first Hello World is printed on our screen, there will be little excitement O (∩_∩) o~

So, how do we greet the world with Python? (⊙o⊙) Well, not too simple >_<, there are wood, there are wood! Haha, look to know:

>>>print "Hello World"

Hello World

Uh, well, that's the simple ^_^.

Ii. Basics of Python

1. Basic data types

1.1 Shaping

i = 1

1.2 Floating-point type

F = 1.2

1.3 String Type

s = "string"

For strings, you can use double quotation marks or single quotes. If the string contains quotation marks, you can use \ ' or \ ' to escape, or you can use the form "'" or "'" (Note:

The quotation marks on both sides must appear in pairs.

1.4 Boolean Type

b = True

c = False

Note: As with other languages, a value in Python, as long as it is not null, "", False, 0, then its boolean value must be True.

1.5 Checking data types

In Python, through the type () function, you can check what type a value is:

>>> A = 10
>>> type (a)
<type ' int ' >

2. Sequence

2.1

Not finished, to be continued ...

Python Learning Notes

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.