Learn English in Python bultins 2018-10-3 all-any-abs
2021-05-20 06:28
标签:音调 war 奇数 state port 公众 turn ogr happening 说明: 1 generator 2 exceptions 3 Noteworthy 4 nil 5 Ellipsis 6 represents 7 slice 8 Variables 9 definition 10 omitted omit 11 signature 12 boolean 13 iterable 【以下为英文注释和个人理解:】 all和any 的英注释和翻译: all函数:Return True if bool(x) is True for all values x in the iterable any 函数:Return True if bool(x) is True for any x in the iterable 【以下为代码验证】 Learn English in Python bultins 2018-10-3 all-any-abs 标签:音调 war 奇数 state port 公众 turn ogr happening 原文地址:https://www.cnblogs.com/wujianghu/p/9740363.html# encoding: utf-8
# module builtins
# from (built-in)
# by generator 1.145
"""
Built-in functions, exceptions, and other objects.
Noteworthy: None is the `nil‘ object; Ellipsis represents `...‘ in slices.
"""
# no imports
# Variables with simple values
# definition of False omitted
# definition of None omitted
# definition of True omitted
# definition of __debug__ omitted
# functions
def abs(*args, **kwargs): # real signature unknown
""" Return the absolute value of the argument. """
pass
def all(*args, **kwargs): # real signature unknown
"""
Return True if bool(x) is True for all values x in the iterable.
If the iterable is empty, return True.
"""
pass
def any(*args, **kwargs): # real signature unknown
"""
Return True if bool(x) is True for any x in the iterable.
If the iterable is empty, return False.
"""
pass
[ ]里为音标及某字典的释义 , { }里为某字典里的其中一个英文释义及中文解释 , 里为本人理解 ,内容为复制+编辑,可能会有错误
[ 英 [‘d?en?re?t?] 美 [‘d??n?ret?]n. 发电机;发生器;生产者]
{something that producessometing else 产生者}
[ 英 [?k‘sep?(?)n; ek-] 美 [?k‘s?p??n] n. 例外;异议]
{something or someone that is not inclued in a general statement or does not follow a rule or pattern 异常,例外,异议,除外}
2.1 includedinclude
[ 英 [?n‘klu?d] 美 [?n‘klud]vt. 包含,包括]
{if one thing includes another,the second thing is part of the first 包括,包含}
[ 英 [‘n??tw??e?] 美 [‘notw?ei] adj. 值得注意的;显著的]
{important or interesting enough to deserve your attention}
3.1 deserve
[ 英 [d?‘z??v] 美 [d?‘z?v] vi. 应受,应得 vt. 应受,应得]
{to have earned something by good or bad actions or behaviour 应得,应受到〔奖赏或惩罚〕}
[ 英 [n?l] 美 [n?l] n. 无,零 n. (Nil)人名;(阿拉伯、土、土库、阿塞、哈萨、塔吉、吉尔、乌兹、匈)尼尔]
{nothing}
[ 英 [?‘l?ps?s] 美 [?‘l?ps?s] n. 省略;省略符号;脱漏]
{when words are deliberately left out of a sentence, though the meaning can still be understood. For example, you may say ‘He’s leaving but I’m not’ instead of saying ‘He’s leaving but I’m not leaving.’〔不影响意义的句子成分的〕省略}
[ 英 [?repr??zents] 美 [?r?pr??z?nts] v. 代表(represent的三单形式);表现,表示;描绘]
{V-T If someone such as a lawyer or a politician represents a person, a group of people, or a place, they act on behalf of that person, group, or place. 代表; 代理}
[英 [sla?s] 美 [sla?s] n. 薄片;部分;菜刀,火铲 vt. 切下;把…分成部分;将…切成薄片 vi. 切开;割破]
{a thin flat piece of food cut from a larger piece}
7.1 flat
[ 英 [fl?t] 美 [fl?t]
adj. 平的;单调的;不景气的;干脆的;平坦的;扁平的;浅的
adv. (尤指贴着另一表面)平直地;断然地;水平地;直接地,完全地
n. 平地;公寓;平面
vt. 使变平;[音乐]使(音调)下降,尤指降半音
vi. 逐渐变平;[音乐]以降调唱(或奏)
n. (法)弗拉特(人名);(英)弗莱特(人名)]
{smooth and level, without raised or hollow areas, and not sloping or curving
平的,平坦的}
一块又薄又平的>
7.1.1 smooth
[ 英 [smu?e] 美 [sm?e]
adj. 顺利的;光滑的;平稳的
vt. 使光滑;消除(障碍等);使优雅;缓和
n. 平滑部分;一块平地
vi. 变平静;变平滑
adv. 光滑地;平稳地;流畅地]
{a smooth surface has no rough parts, lumps, or holes, especially in a way that is pleasant and attractive to touch 平滑的,光滑的}
7.1.1.1 rough
[ 英 [r?f] 美 [r?f]
adj. 粗糙的;粗略的;粗野的;艰苦的;未经加工的
vt. 使粗糙;粗暴对待;草拟
n. 艰苦;高低不平的地面;未经加工的材料;粗糙的部分
vi. 举止粗野
adv. 粗糙地;粗略地;粗暴地
n. (Rough)人名;(英)拉夫]
{having an uneven surface}
[ 英 美 [‘v?r??bl]n. [数] 变量]
{ key variables 关键变量
dummy variables 虚拟变量
Bind Variables 绑定变量
State Variables 状态变量
reference variables 参考变量
Induced variables 引致变量
variables separation 分离变量
Process Variables 过程变量
static variables 静态变量}
[ 英 [def?‘n??(?)n] 美 [,d?f?‘n???n] n. 定义;[物] 清晰度;解说]
{a phrase or sentence that says exactly what a word, phrase, or idea means 定义,释义}
[ 英 [??‘m?t?d] 美 [o?‘m?t?d] adj. 省略了的;省去的 v. 遗漏,省略(omit的过去分词)]
{If you omit something, you do not include it in an activity or piece of work, deliberately or accidentally. 删节; 省略; 遗漏}
10.1 deliberately
[ 美 [d?‘l?b?r?tli] adv. 故意地;谨慎地;慎重地]
{}
10.2 accidentally
[ 英 [?ks?‘dent(?)l?] 美 [,?ks?‘d?ntli] adv. 意外地;偶然地]
{}
[ 英 [‘s?gn?t??] 美 [‘s?gn?t??] n. 署名;签名;信号]
{your name written in the way you usually write it, for example at the end of a letter, or on a cheque etc, to show that you have written it〔书信结尾处、支票上等的〕签字,签名}
[[‘bu:li?n] adj. 布尔数学体系的]
{a Boolean system is based on things that can be eigher True of False,but not both, It links statements with words called operators,such as and ,or and not ,Boolean systerms are used to write computer programs ,especially internet search programs 布尔〔罗辑体系〕,布尔的
〔用于编写电脑程序,尤其是网络搜索程序〕}
[ 无]
{Asynchronous iterable 可异步迭代对象
iterable objects 可迭代对象
Cursor will be iterable 光标
Document Collections will be iterable 所收集的文件}
13.1 cursor
[ 英 [‘k??s?] 美 [‘k?s?]
n. 光标;(计算尺的)[计] 游标,指针]
{a mark that can be moved around a computer screen to show where you are working
〔计算机的〕光标}
13.2 asynchronous
[ 英 [?‘s??kr?n?s; e?-] 美 [e‘s??kr?n?s] adj. [电] 异步的;不同时的;不同期的]
{无}
abs函数:绝对值!Return the absolute value of the argument:返回参数的绝对值
if the iterable is empty ,return True
:x是可迭代对象(比如列表)的元素,bool(x)全部为True时才返回True
假如对象为空的,这个要记着,为空时返回True
If the iterable is empty, return False.
:只要bool(x)有一个为True,any(arg_iterable)就返回True
假如对象为空的,返回False
abs函数:绝对值!Return the absolute value of the argument:返回参数的绝对值a = abs(3.4)
b = abs(-12)
c = abs(-0)
d = abs(0)
print(a,b,c,d)#3.4 12 0 0
any 和 all 函数:
iterable_any1 = iterable_all1 = [1,0,3,‘一‘,‘三‘,‘五‘]
print(all(iterable_all1))#False
print(any(iterable_any1))#True
iterable_any2 = iterable_all2 = [1,2,3,‘‘,‘三‘,‘五‘]
print(all(iterable_all2) , any(iterable_any2)) #False True
iterable_any3 = iterable_all3 = [1,2,3,True,‘三‘,‘五‘]
print(all(iterable_all3) , any(iterable_any3)) #True True
iterable_any4 = iterable_all4 = [1,2,3,False,‘三‘,‘五‘]
print(all(iterable_all4) , any(iterable_any4)) #False True
iterable_any5 = iterable_all5 = [1,0,0,False,‘‘,‘‘]
print(all(iterable_all5) , any(iterable_any5)) #False True
iterable_any6 = iterable_all6 = [0,0,0,False,‘‘,‘‘]
print(all(iterable_all6) , any(iterable_any6)) #False False
iterable_any7 = iterable_all7 = []
print(all(iterable_all7) , any(iterable_any7)) #True False
cyan = lambda x:‘\033[36m%s\033[0m‘%x
print(cyan(‘bool(None):%s\n bool(False):%s\n bool(0):%s\n bool(list):%s\n bool(dict):%s\n bool(tuple):%s\nbool(int):%s\n‘%
(bool(None) , bool(False) , bool(0) , bool(list) , bool(dict) ,bool(tuple),bool(int))))
bool(None):False
bool(False):False
bool(0):False
bool(list):True
bool(dict):True
bool(tuple):True
bool(int):True
文章标题:Learn English in Python bultins 2018-10-3 all-any-abs
文章链接:http://soscw.com/essay/87862.html