Basic function Summary for Python base type

Source: Internet
Author: User

# "" "sets    " "" "Len+*find,replacesplitisalpha,isdigit,rstrip"%s "str     Len (s) s[0],s[-1]     (raw) s =  ' Sam '     s =  ' s ' +s[1: ]    print s             sam    line=  ' aaa,bbb,ccc,ddd '     print line.split (', ')     line = line.split (', ')     print line      "Result": [' AAA ',  ' BBB ',  ' CCC ',  ' DDD ']              [' aaa ',  ' BBB ',  ' CCC ',  ' DDD ']    line=   ' aaa,bbb,ccc,ddd,\n '     line = line.rstrip () # #print  line     aaa,bbb,ccc,ddd,    print  '%s is %s '  %  (' I ',  ' You ')     p rint  '%s '  %  ' you '     i is you    you (...)     appendpop,sort,reverse,insert,        remove, Rstrip....list    list "". Joinlistlist1 = [1, 3, 4, 5, 5,  7]    print list1[0]    list1[0]=22     print list1    print list1[0:3:1] # #list1 [begin:end:step]     base = [' A ',  ' B ',  2.33, [' a ',  ' BC ']]    base.append (' ABC ',))     print base  # #base. append[' A ',  ' B ',  2.33, [' a ',   ' BC '],  (' abc ',)]    base = [' a ',  ' B ',  2.33, [' a ',   ' BC ']]    base.append ((' abc ',))    # #print  base     base.pop (2)      # #print  base    base.sort ()      ## Print base    base.reverse ()   # #print  base    [' a ' ,  ' B ',  2.33, [' a ',  ' BC '],  (' abc ',)]    [' a ',  ' B ',  [' a ',   ' BC '],  (' abc ',)]    [[' a ',  ' BC '],  ' a ',  ' B ',  (' abc ',)]     [(' abc ',),  ' B ',  ' A ',  [' a ',  ' BC ']]  foriterable () res =  [ord (x)  for x in  ' spam '] # #ord () asciiprint res    [115 ,  112, 97, 109]    [expression for target1 in iterable1  [if condition1]]..         for targetn in iterablen[if condition]         ifdef fun ():     return [(x, Y)  for x in range (5)  if x % 2 == 0 for    y in range (5)  if y%2 ==1]    print fun ()      [(0, 1),  (0, 3),  (2, 1),  (2, 3),  (4, 1),  (4,  3)]d[key]dkeyvalue,d.keys () dkeykeyvalue,keyclear () keys () values (), Items () D.get (Key[,d]) Keyd[key],d,none     pop (Key[,d]) keykeyssortd = {' A ': 1,  ' B ': 2}     print d    ks = list (D.keys ())     print ks     ks.reverse ()     print ks    for key  in Ks:        print  (key,  ' ==> ',  d[key])      (' B ',  ' ==> ',  2)      (' A ',  ' ==> ',  1) tuple     t. Index (4)   4t.count (4)   4tup1+tup2del tup,cmp (tup1,tup2)   len (tup)          max/min (tuple)       /,


Basic function Summary for Python base type

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.