Python lesson First day notes-la

Source: Internet
Author: User

http://www.cnblogs.com/onda/ ----------------------201,704,231: Cpython  pypy difference, etc.; Cpython is a one-line explanation, PyPy is the whole file explanation two: Pycharm use:        1: Create project         2: Set character sets utf8        3: Set default Create file   start   #!/usr/bin/env python   and UTF8 read         4: Modify Mouse wheel (Ctrl) to modify text size   in setting   search mous three: input and output: Inputs  print  Four: variables:        1: Letters, numbers (cannot start), underscores         2: cannot be a python default string         3: Conform to popular thinking, split five with underscore: Comment, single line #   multiline '   ' Six: Format (indent): Pycharm is the tab (4 spaces) used. Seven: If judgment:     If condition:                        expression                     elif conditions:              &N Bsp         expressions                     else:    &N Bsp &nBsp                 expression eight: Loop         1:  while   expression: &nbs p; (Expression-->true   Enter loop)                 expression         &NB Sp       Continue jump out of the loop                 break   jump out of the loop          2  for  i (loop body)  in  range (Ten)   by loop body:          &NBS P     expression   Nine: Data type:    1 integer int    2 Bohr bool    3 string str 10: Other:    1: Remove empty on edge White  strip ()  lstrip ()     2: Split Split (' delimiter ')   default is space     3: Length  len     4: Index strings and lists are ordered by a= ' AB '   a[0]   print out "a"     5: Slices and indexes are similar, not only can you specify a location, you can also specify a section of a[0:2]     11: List  A=[]         convert strings to lists with list, whereas str#### #列表的方法A. Index (' value ') to find the position of the value  a.append (' Value ')     --> Append value a.count (' value ')     --> count, number of a.extend (' list ') of a value      --> Merge List A.index ()     --> View value location A.insert (position, ' value ')     --> Insert A.pop ()         --> Delete last A.remove ()     --> Delete the specified a.reverse ()     --> Flip List a.sort ()     --> sort 12: Dictionary   b={' key ': value}        value can be   dictionary, list, tuple   etc a= (' A ', ' B ', ' C ') # # #方法只有俩个index       Find location count     number of units to find ########## #元组和列表   convert tuple (list)      Turn list into tuple list (tuple)      turn tuple into List 13: IO file     Open: f=file (' 1.txt ', ' R ')             F.read ()             F.close ()     write: W=file (' 1.txt ', ' W ') &nbsp ;           W.write ()             W.close ()  

Python lesson First day notes-la

Related Article

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.