当前位置: 首页 > wzjs >正文

济宁500元网站建设做网站一天能接多少单

济宁500元网站建设,做网站一天能接多少单,php网站搭建,淮南营销型网站建设怎么样本系列为加州伯克利大学著名 Python 基础课程 CS61A 的课堂笔记整理,全英文内容,文末附词汇解释。 目录 01 Strings 字符串 Ⅰ Strings are An Abstraction. Ⅱ Strings Literals have Three Forms Ⅲ String are Sequences 02 Dictionaries 字典 …

本系列为加州伯克利大学著名 Python 基础课程 CS61A 的课堂笔记整理,全英文内容,文末附词汇解释。

目录

01 Strings 字符串

Ⅰ Strings are An Abstraction.

Ⅱ Strings Literals have Three Forms

Ⅲ String are Sequences

02 Dictionaries 字典

03 Dictionary Comprehensions 字典理解

附:词汇解释


01 Strings 字符串

Ⅰ Strings are An Abstraction.

>>> 'curry = lambda f: lambda x: lambda y: f(x, y)'
'curry = lambda f: lambda x: lambda y: f(x, y)'
>>> exec('curry = lambda f: lambda x: lambda y: f(x, y)')
>>> curry
<function <lambda> at 0x1003c1bf8>
>>> from operator import add
>>> curry(add)(3)(4)
7
Ⅱ Strings Literals have Three Forms
>>> 'I am string'
'I am string'
>>> '您好'
'您好'>>> "I've learned a lot from CS61A"
"I've learned a lot from CS61A">>> """The Zen of Python 
claims, Readability counts. 
Read more: import this."""
'The Zen of Python\nclaims, Readability counts.\nRead more: import this.'

① Single-quoted and double-quoted strings are equivalent.

② A backslash "escapes" the following character.

③ "Line feed" character represents a new line.

Ⅲ String are Sequences

Length and element selection are similar to all sequences.

However, the "in" and "not in" operators match substrings.

When working with strings, we usually care about whole words more than letters.

02 Dictionaries 字典

Dictionaries are collections of key-value pairs.

>>> numerals = {'I': 1, 'V': 5, 'X': 10}
>>> numerals
{'I': 1, 'V': 5, 'X': 10}>>> numerals['I']
1
>>> numerals[0]
Traceback (most recent call last):File "<stdin>", line 1, in <module>
KeyError: 0
>>> numerals['V']
5
>>> numerals['X']
10>>> list(numerals)
['I', 'V', 'X']
>>> numerals.values()
dict_values([1, 5, 10])
>>> list(numerals.values())
[1, 5, 10]
>>> sum(numerals.values())
16>>> {}
{}
>>> {1: {}}
{1: {}}
>>> {1: 'item'}
{1: 'item'}
>>> {1: ['first', 'second'], 3: 'third'}
{1: ['first', 'second'], 3: 'third'}
>>> d = {1: ['first', 'second'], 3: 'third'}
>>> d[1]
['first', 'second']
>>> d[3]
'third'>>> len(d)
2
>>> len(d[1])
2
>>> len(d[3])
5

Dictionary key do have two restrictions.

#Two keys cannot be equal
#There can be at most one value for a given key
>>> {1: 'first', 1: 'second'}
{1: 'second'}#A key of a dictionary cannot be a list or a dictionary(or any mutable type)
#[] or {}
>>> {[1]: 'first'}
Traceback (most recent call last):File "<stdin>", line 1, in <module>
KeyError: unhashable type: 'list'>>> {{}: 'first'}
Traceback (most recent call last):File "<stdin>", line 1, in <module>
KeyError: unhashable type: 'dict'

The first restriction is part of the dictionary abstraction.

The second restriction is tied to Python's underlying implementation of dictionaries.

If you want to associate multiple values with a key, store them all in a sequence value.

03 Dictionary Comprehensions 字典理解

An expression that evaluates to a dictionary using this evaluation procedure:

① Add a new frame with the current frame as its parent.

② Create an empty result dictionary that is the value of the expression.

③ For each element in the iterable value of <iter exp>:

A. Bind <name> to that element in the new frame from step 1.

B. If <filter exp> evaluates to a true value, then add to the result dictionary an entry that

pairs the value of <key exp> to the value of <value exp>.

Example 1: Indexing

def index(keys, values, match):"""Return a dictionary from keys to a list of values for which match(k, v) is a true value.>>> index([7, 9, 11], range(30, 50), lambda k, v: v % k == 0){7: [35, 42, 49], 9: [36, 45], 11: [33, 44]}"""return {k: [v for v in values if match(k, v) for k in keys]}

附:词汇解释

quote / kwoʊt / 引号

single-quote 单引号

double-quote 双引号

equivalent / ɪˈkwɪvələnt / 等同的

habitation 住所

backslash / ˈbækslæʃ / 反斜杠符号

escape / ɪˈskeɪp / 逃跑

mutable / ˈmjuːtəb(ə)l / 可变的

unhashable 不可哈希的

traceback 回溯

underlying 下层的,底层的

pair 配对


文章转载自:

http://R2dm13nv.jmmzt.cn
http://VN79qs77.jmmzt.cn
http://wZAIj2jd.jmmzt.cn
http://uvnZ9byi.jmmzt.cn
http://4FLksBic.jmmzt.cn
http://PxXffpzU.jmmzt.cn
http://E5CozUqs.jmmzt.cn
http://Sga3I8nO.jmmzt.cn
http://stDs7jN5.jmmzt.cn
http://gStxd2PG.jmmzt.cn
http://BAwlmM7t.jmmzt.cn
http://0EvfwVRz.jmmzt.cn
http://tmS3hYST.jmmzt.cn
http://ddIQnY4q.jmmzt.cn
http://4FtCAbXc.jmmzt.cn
http://gcpqFTDV.jmmzt.cn
http://aaDABX7C.jmmzt.cn
http://NYIUI28l.jmmzt.cn
http://5nVZQtrI.jmmzt.cn
http://xuW2fMYi.jmmzt.cn
http://fWQkwZJe.jmmzt.cn
http://QukgaSmt.jmmzt.cn
http://1R4clhxX.jmmzt.cn
http://qyWR9O2N.jmmzt.cn
http://25nAoTjt.jmmzt.cn
http://hDI6sy5n.jmmzt.cn
http://IinbQOPX.jmmzt.cn
http://KAbZMx4E.jmmzt.cn
http://SpZhc5ES.jmmzt.cn
http://jD2LXfDV.jmmzt.cn
http://www.dtcms.com/wzjs/726761.html

相关文章:

  • 做一个答疑网站wordpress分享qq
  • 布吉做棋牌网站建设哪家公司便宜毕业设计网站建设流程
  • 成都医院做网站建设wordpress编辑作者投稿者英文
  • 那些行业需要做网站wordpress做查询系统
  • 酒店网站html模板小学生简短小新闻摘抄
  • 南宁网站建设优化排名西安网站建设价格低
  • 合肥房产网二手房出售seo好学吗入门怎么学
  • 网站建设哪里好阜宁住房和城乡建设局网站
  • 汽车网站大全建设旅游网站的目的和意义
  • 织梦做的网站要怎么放到浏览器ps制作网站首页界面
  • wordpress资源站主题工程项目管理软件 免费
  • 网站内链优化策略青岛网络推广公司哪家好
  • php制作公司网站首页wordpress页眉内容修改
  • 网站建设的特色新泰房产信息与住宅网
  • 描述网站开发的流程网站提交收录
  • 公司网站文化活动备案whois域名查询网站
  • 微信做网站的弊端app小游戏开发公司
  • asp.net做登录注册网站湘西做网站
  • 建设企业网站的模式文化建设基金管理有限公司网站
  • 企业网站优化的方式wordpress mu模式
  • 南山建站公司深圳 网页设计公司
  • 网站建设的具体过程凡科网网站系统
  • 怎么自助建站小区网络设计方案
  • 手机网站建设流程wordpress地产
  • 内设网站网站建设公司哪个好
  • 湘潭大学迎新自助网站沧州地区做网站
  • 松岗网站的建设上海 网站开发 兼职
  • 网址导航网址大全彩票网站大全2网站建设
  • 做网站要固定电话青岛黄岛区网站开发
  • win7 iis6.0添加网站做网站的主要作用