首页 > 编程语言 > 详细

Python学习过程中知识误区总结

时间:2015-06-18 21:43:28      阅读:300      评论:0      收藏:0      [点我收藏+]
  1. a**b==a*b+a
  2. 字符串 ‘abc‘ 3 * ‘ab‘== ‘ababab‘   ‘a‘+str(123) == ‘a123‘
  3. len(‘abc‘) ==3

          indexing  ‘abc‘[0] == ‘a‘   ‘abc‘[-1] == ‘c‘ 

          Slicing       ‘abc‘[1:3] == ‘bc‘     [i:j:k]   最后一个参数 step 为负时,表示截取结果按照逆序排列

     4.  in

The operators in and not in test for collection membership (a ‘collection‘ refers to a string, list, tuple or dictionary - don‘t worry, we will cover lists, tuples and dictionaries soon!). The expression

Note this returns the negation of element in coll - that is, the expression element not in coll is equivalent to the expression not (element in coll).

    5.技术分享

    6.

   

 

 

 

         

Python学习过程中知识误区总结

原文:http://www.cnblogs.com/fusama/p/4586741.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!