Python learning Diary [1]

Source: Internet
Author: User

Day1:

Input and OUTPUT statements: input, print

Control statements: If, else, elif ...

Loop statement: for (similar to foreach inside C #), while ...

Type (), Isinstance () ...

Data type:

int, float, bool, str ... '

operator

**, //,

...

List: A hormone-hit array

P.S. You can add any element, regardless of type

Method

Append ()

#add a new value in the end of the list

Pop ()

#remove the top member of the list, this method would return this member as well. (The same as the method in stack)

Remove ()

Del

List_name[number:number]

< > ...

Operator for List

Inch

For some instance to confirm if it is contained

Dir (list) .....

p.s.----Dir (list)

>>> dir (list)

[' __add__ ', ' __class__ ', ' __contains__ ', ' __delattr__ ', ' __delitem__ ', ' __delslice__ ', ' __doc__ ', ' __eq__ ', ' __format_ ' _ ', ' __ge__ ', ' __getattribute__ ', ' __getitem__ ', ' __getslice__ ', ' __gt__ ', ' __hash__ ', ' __iadd__ ', ' __imul__ ', ' __init_ _ ', ' __iter__ ', ' __le__ ', ' __len__ ', ' __lt__ ', ' __mul__ ', ' __ne__ ', ' __new__ ', ' __reduce__ ', ' __reduce_ex__ ', ' __repr__ ' , ' __reversed__ ', ' __rmul__ ', ' __setattr__ ', ' __setitem__ ', ' __setslice__ ', ' __sizeof__ ', ' __str__ ', ' __subclasshook__ ' ', ' append ', ' count ', ' extend ', ' index ', ' Insert ', ' pop ', ' remove ', ' reverse ', ' sort ']

Python learning Diary [1]

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.