前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Python Learning: 02

Python Learning: 02

作者头像
py3study
发布2020-01-17 13:14:36
2280
发布2020-01-17 13:14:36
举报
文章被收录于专栏:python3python3

  OK, let's continue.

  • Conditional Judgments and Loop
    • if
    • if-else
    • if-elif-else
    • while
    • for
    • break
    • continue
    • multiple loop
  • Differences between Dict and Set
    • Dict: A kind of structure in the type of "Key-Value"
      • described in "{}"
      • formed by "key: value"
      • function "len()" to calculate the length
      • judge empty:① if 'key' in dict  ②dict.get('key')  ->if empty, return None automatically
      • the key in dict is unchangeable
    • Set: A kind of struture in the type of Non-repeating elements collection
      • described in "set([,,,,])" 
      • add() to add elements
      • remove() to delete elements
  • Functions
    • where to searching functions: http://docs.python.org/2/library/functions.html#abs
    • some common functions: abs(), cmp(), int(), str(), sum() 
    • the Return Value of Functions

        A function can return single value, as well as return more value. But in essence it returns one, a tuple. The function treats the values as a tuple.

代码语言:javascript
复制
1 >>> r = move(100, 100, 60, math.pi / 6)
2 >>> print r
3 (151.96152422706632, 70.0)
    • recursive functions:  take care of overflowing
    • default parameter: set default parameter in the function line in the blankets, and the default parameter must be set at the right side 
    • variable parameter: use '*' to mark variable parameter , and they are regarded as a tuple
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-05-11 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档