There is eight key elements of Python

Source: Internet
Author: User

1. Data type

2. Variant

Grammer:objectreference = value

' = ' means bind a variant with object in memory.

Variant name is case sensitive in Pyhon.

3. Combination data type

Major types is meta and list

Meta is fixed.

List is changable.

#x. Append (XXX) = = List.append (x, ' xxx ')

There is the methods in Python. As following.

functionname (arguments)

Objectname.methodname (arguments)

4. Logical operator

Sometimes "is" would give you a different result. In fact. Its compared with memory object.

0<=a<=10 equal a>=0 and a<=10

"In" was better used in Dict

5. Control

A.
If Boolean_expression1:

Suite1

Elif Boolean_expression2:

....

Else

Else_suite

B.

While Boolean_expression:

Suite

C.

For variable in iterable:

Suite

6. Mathmatic

List must use Iterable object.

e.g. seeds+=5 # would get error

SEEDS+=[5] #correct

7. IO

Try

...

Except ValueError as err:

Print (ERR)

Continue

Except Eoferror:

Break

8. function

def functionname (Argument1,a2,a3 ...):

Suite

There is eight key elements 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.