Day 12 20190127 老男孩python学习第12天 内容整理

字典类型详细方法,写作业,2小时半

 集合,半小时:

集合也是无序的,与字典不同的区别在于集合是这样的 set = {3, 2, 1, 4}

注意:集合存在的意义就在于去重和关系运算

 

确定性,无序性,去重性

1. 交集 set1 & set2 或者 set1.intersection(set2),除了合并之外还有去重功能

2. 并集 set1 | set2 或者 set1.union(set2)

3. 差集 set1.difference(set2) 或者 set1 - set2,即在set1中而不在set2中的集合

4. 对称差集 set1.symmetric_difference(set2) 或者 set1 ^ set2,去掉兼有的,留下独自的,合并成一个集合

 

set1 in set2

set1 not in set2

set1 == set2

set1 != set2

 

两个集合之间一般有三种关系,相交、包含、不相交。在Python中分别用下面的方法判断:

  • set.isdisjoint(s):判断两个集合是不是不相交
  • set.issuperset(s):判断集合是不是包含其他集合,等同于a>=b
  • set.issubset(s):判断集合是不是被其他集合包含,等同于a<=b

s.add()

s.discard()

s.remove()

s.pop()

s.clear()

转载于:https://www.cnblogs.com/Jack1314/p/10325866.html

PyCharm is addictive, with powerful and configurable code completion, superb editing tools, top-notch support, diverse plugins, and a vibrant ecosystem to boot. Learning how PyCharm works and maximising the synergy of its powerful tools will help you to rapidly develop applications. From leveraging the power of the editor to understanding PyCharm’s internals, this book will give you a comprehensive view of PyCharm and allow you to make your own choices about which workflow and tools are best for you. You will start by getting comfortable with PyCharm and making it look exactly like you want. You can customize the tools and taskbars to suit individual developers’ coding styles. You also learn how to assign keyboard shortcuts. You will master debugging by inserting breakpoints, collecting runtime data, and debugging from the console. You will understand how PyCharm works underneath and how plugins such as Codemap, Vim, Bitbucket, Assets compressor, markdown, bash file, shortcut translator, and .gitignore leverage the power of the IntelliJ platform. You will become comfortable using the VCS interface in PyCharm and see the benefits of using it for some simple tasks as well as some more complex tasks such as partial commits using changelists. You will take an in-depth look at the various tools in PyCharm, improving your workflow drastically. Finally, you will deploy powerful PyCharm tools for Django, Flask, GAE, and Pyramid Development, becoming well acquainted with PyCharm’s toolset for web development with popular platforms. Packed with insider tricks, this book will help you boost productivity with PyCharm. What You Will Learn Understand the internal workings of the IntelliJ Platform Leverage PyCharm’s powerful search tools, and learn which ones are the best for you and your workflow Customize PyCharm’s enhanced Python interpreter and its inbuilt terminal Develop web applications quickly and easily with different frameworks such as Flask and Django Understand
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值