Python编程术语词汇表(一)
yund56 2025-05-15 23:27 18 浏览
这是一个非官方的 Python 编程术语表,是日常编程实践以及网络收藏所得的内容集合。
Iteration 迭代
Looping over an iterable object.
遍历可迭代对象。
A for loop is the epitome of iteration, but there are many other ways to iterate over an iterable in Python.
一个 for 循环是迭代的典范,但在 Python 中还有许多其他方法可以遍历可迭代对象。
Iterable 可迭代
(Our perspective as Python users) Anything you can loop over with a for loop or by various other forms of iteration. More on iterables in What is an iterable.
(作为 Python 用户的我们) 你可以用 for 循环或通过其他各种迭代形式遍历的任何内容。关于可迭代对象的更多信息,请参阅什么是可迭代对象。
(Python's perspective) Anything that can be passed to the built-in iter function to get an iterator from it. If you're inventing your own iterable class, also see How to make an iterable.
(Python 视角)任何可以被传递给内置的 iter 函数以从中获取迭代器的对象。如果你正在创建自己的可迭代类,也请参阅如何创建可迭代对象。
String 字符串
Strings are a data type used for storing text. Strings are made up of characters, which may be letters, numbers, symbols, whitespace, emoji, etc.
字符串是用于存储文本的数据类型。字符串由字符组成,可以是字母、数字、符号、空白、表情符号等。
Substring 子字符串
A "substring" is a string that is contained within another string.
一个“子字符串”是包含在另一个字符串中的字符串。
As an example, "tho" is a substring of "Python".
例如, "tho" 是 "Python" 的子串。
Boolean 布尔
Python's two Boolean values are True and False. These values both have the type of bool, which stands for Boolean (named after George Boole, in case you're curious).
Python 的两个布尔值是 True 和 False 。这两个值都具有 bool 类型,代表布尔(如果你好奇,这个名字是为了纪念乔治·布尔)。
Integer (a.k.a. int) 整数(又称 int )
Integers are used for representing whole numbers in Python. The numbers 5, 0, and -2 are examples of integers.
整数用于在 Python 中表示整数。数字 5 、0 和 -2 是整数的例子。
Floating Point Numbers (a.k.a. float)
浮点数(又称 float )
Floating point numbers are used for representing non-integers. The numbers 5.0, 2.5, and -3.4 are examples of floating point numbers.
浮点数用于表示非整数。数字 5.0 、 2.5 和 -3.4 是浮点数的示例。
Floating point numbers may be equivalent to integers. For example, 5.0 is equal to 5 in Python: 5.0 == 5 returns True.
浮点数可能与整数等价。例如,在 Python 中 5.0 等于 5 : 5.0 == 5 返回 True 。
Index 索引
An integer that represents the position of an item within a list or another sequence.
一个表示列表或另一个序列中项目位置的整数。
Sequences in Python use zero-based indexes, so the first item is at position 0.
Python 中的序列使用零基索引,因此第一个元素位于位置 0 。
Sequence (a.k.a. "list-like object")
序列(又称“类似列表的对象”)
An ordered collection of objects. Sequences have a length (via the built-in len function), can be indexed (starting at 0), and are iterable.
一个有序的对象集合。序列具有长度(通过内置的 len 函数),可以索引(从 0 开始),并且是可迭代的。
Mapping 映射
A dictionary-like object. An object which stores key-value pairs and supports key lookups using square brackets ([...]), among other features we expect dictionary-like objects to support (such as being an iterable). Like sequences, mappings are iterable.
一个类似字典的对象。一个存储键值对并支持使用方括号( [ ... ] )进行键查找的对象,以及其他我们期望类似字典对象支持的功能(如可迭代)。像序列一样,映射是可迭代的。
Tuple 元组
An immutable sequence. Tuples act like a list, but they can't be mutated. While tuples could just be thought of as immutable lists, we usually use the two quite differently: tuples are for storing a fixed number of values, often of different types.
一个不可变序列。元组的行为类似于列表,但不能被修改。虽然元组可以简单地被视为不可变列表,但我们通常使用它们的方式相当不同:元组用于存储固定数量的值,通常是不同类型的值。
List Comprehension 列表推导
A special syntax for building a new list/set/dictionary out of an old iterable. Comprehensions build a new iterable out of an old one while either filtering items down based on a condition or modifying each item based on a mapping expression.
特殊语法,用于从旧的可迭代对象中构建新的列表/集合/字典。列表推导从旧的可迭代对象中构建新的可迭代对象,同时根据条件过滤项目或根据映射表达式修改每个项目。
Truthiness 真实性
Truthiness asks the question "if we convert this object to a Boolean, will we get True or False?"
真实性询问问题:“如果我们将此对象转换为布尔值,我们会得到 True 还是 False ?”
Containment 隔离
Python's in operator checks for "containment": x in y means y "contains" x. All iterables support containment by default, but some objects customize containment checks to make them faster (dictionary containment) or to operate slightly differently (substring checks).
Python 的 in 运算符检查“包含”: x in y 表示 y “包含” x 。所有可迭代对象默认支持包含,但某些对象自定义包含检查以使其更快(字典包含)或略有不同(子字符串检查)。
Lexicographical ordering 词典顺序
Strings, tuples, and lists in Python are ordered "lexicographically".
Python 中的字符串、元组和列表是按“字典序”排序的。
Lexicographical ordering essentially means "similar to alphabetical ordering". For example, "animal" < "apple" is True because since the first letters are equivalent, the second letters are compared and "n" < "p" (in both Unicode and the alphabet). Likewise, (1969, 5, 18) < (1969, 7, 16) is True because since the first indexes are equivalent, the second indexes are compared and 5 < 7.
词序排列本质上意味着“类似于字母顺序”。例如, "animal" < "apple" 等于 True ,因为第一个字母相同,所以比较第二个字母(在 Unicode 和字母表中)。同样, (1969, 5, 18) < (1969, 7, 16) 等于 True ,因为第一个索引相同,所以比较第二个索引和 5 < 7 。
File-like Object 文件对象
A file-like object is an object that behaves like a file.
文件类对象是一种表现得像文件的对象。
Files are file-like objects, but so are the standard input (sys.stdin), standard output (sys.stdout), and standard error (sys.stderr) file streams. It's also possible to create your own file-like objects.
文件是类似文件的对象,但标准输入( sys.stdin )、标准输出( sys.stdout )和标准错误( sys.stderr )文件流也是如此。也可以创建自己的类似文件的对象。
如果你觉得这篇文章对你有帮助,欢迎点赞、收藏和转发!关注我,获取更多 Python 编程技巧和实用知识
相关推荐
- SM小分队Girls on Top,女神战队少了f(x)?
-
这次由SM娱乐公司在冬季即将开演的smtown里,将公司的所有女团成员集结成了一个小分队project。第一位这是全面ACE的大姐成员权宝儿(BoA),出道二十年,在日本单人销量过千万,韩国国内200...
- 韩国女团 aespa 首场 VR 演唱会或暗示 Quest 3 将于 10 月推出
-
AmazeVR宣布将在十月份举办一场现场VR音乐会,观众将佩戴MetaQuest3进行体验。韩国女团aespa于2020年11月出道,此后在日本推出了三张金唱片,在韩国推出了...
- 韩网热议!女团aespa成员Giselle在长腿爱豆中真的是legend
-
身高163的Giselle,长腿傲人,身材比例绝了...
- 假唱而被骂爆的女团:IVE、NewJeans、aespa上榜
-
在韩国,其实K-pop偶像并不被认为是真正的歌手,因为偶像们必须兼备舞蹈能力、也经常透过对嘴来完成舞台。由于科技的日渐发达,也有许多网友会利用消音软体来验证K-pop偶像到底有没有开麦唱歌,导致假唱这...
- 新女团Aespa登时尚大片 四个少女四种style
-
来源:环球网
- 韩国女团aespa新歌MV曝光 画面梦幻造型超美
-
12月20日,韩国女团aespa翻唱曲《DreamsComeTrue》MV公开,视频中,她们的造型超美!WINTER背后长出一双梦幻般的翅膀。柳智敏笑容甜美。宁艺卓皮肤白皙。GISELLE五官精致...
- 女网友向拳头维权,自称是萨勒芬妮的原型?某韩国女团抄袭KDA
-
女英雄萨勒芬妮(Seraphine)是拳头在2020年推出的第五位新英雄,在还没有正式上线时就备受lsp玩家的关注,因为她实在是太可爱了。和其他新英雄不同的是,萨勒芬妮在没上线时就被拳头当成虚拟偶像来...
- 人气TOP女团是?INS粉丝数见分晓;TWICE成员为何在演唱会落泪?
-
现在的人气TOP女团是?INS粉丝数见分晓!现在爱豆和粉丝之间的交流方法变得多种多样,但是Instagram依然是主要的交流手段。很多粉丝根据粉丝数评价偶像的人气,拥有数百、数千万粉丝的组合作为全球偶...
- 韩国女团MVaespa Drama MV_韩国女团穿超短裙子跳舞
-
WelcometoDrama.Pleasefollow4ruleswhilewatchingtheDrama.·1)Lookbackimmediatelywhenyoufe...
- aespa师妹团今年将出道! SM职员亲口曝「新女团风格、人数」
-
记者刘宛欣/综合报导南韩造星工厂SM娱乐曾打造出东方神起、SUPERJUNIOR、少女时代、SHINee、EXO等传奇团体,近年推出的aespa、RIIZE更是双双成为新生代一线团体,深受大众与粉丝...
- 南韩最活跃的女团aespa,新专辑《Girls》即将发布,盘点昔日经典
-
女团aespa歌曲盘点,新专辑《Girls》即将发布,期待大火。明天也就是2022年的7月8号,aespa新专辑《Girls》即将发行。这是继首张专辑《Savage》之后,时隔19个月的第二张专辑,这...
- 章泽天女团aespa出席戛纳晚宴 宋康昊携新片亮相
-
搜狐娱乐讯(山今/文玄反影/图科明/视频)法国时间5月23日晚,女团aespa、宋康昊、章泽天等明星亮相戛纳晚宴。章泽天身姿优越。章泽天肩颈线优越。章泽天双臂纤细。章泽天仪态端正。女团aespa亮...
- Aespa舞台暴露身高比例,宁艺卓脸大,柳智敏有“TOP”相
-
作为SM公司最新女团aespa,初舞台《BlackMamba》公开,在初舞台里,看得出来SM公司是下了大功夫的,虽然之前SM公司新出的女团都有很长的先导片,但是aespa显然是有“特殊待遇”。运用了...
- AESPA女团成员柳智敏karina大美女
-
真队内速度最快最火达成队内首个且唯一两百万点赞五代男女团中输断层第一(图转自微博)...
- 对来学校演出的女团成员语言性骚扰?韩国这所男高的学生恶心透了
-
哕了……本月4日,景福男子高中相关人士称已经找到了在SNS中上传对aespa成员进行性骚扰文章的学生,并开始着手调查。2日,SM娱乐创始人李秀满的母校——景福高中迎来了建校101周年庆典活动。当天,S...
- 一周热门
- 最近发表
-
- SM小分队Girls on Top,女神战队少了f(x)?
- 韩国女团 aespa 首场 VR 演唱会或暗示 Quest 3 将于 10 月推出
- 韩网热议!女团aespa成员Giselle在长腿爱豆中真的是legend
- 假唱而被骂爆的女团:IVE、NewJeans、aespa上榜
- 新女团Aespa登时尚大片 四个少女四种style
- 韩国女团aespa新歌MV曝光 画面梦幻造型超美
- 女网友向拳头维权,自称是萨勒芬妮的原型?某韩国女团抄袭KDA
- 人气TOP女团是?INS粉丝数见分晓;TWICE成员为何在演唱会落泪?
- 韩国女团MVaespa Drama MV_韩国女团穿超短裙子跳舞
- aespa师妹团今年将出道! SM职员亲口曝「新女团风格、人数」
- 标签列表
-
- filter函数js (37)
- filter函数excel用不了 (73)
- 商城开发 (40)
- 影视网站免费源码最新版 (57)
- 影视资源api接口 (46)
- 网站留言板代码大全 (56)
- java版软件下载 (52)
- java教材电子课本下载 (48)
- 0基础编程从什么开始学 (50)
- java是用来干嘛的 (51)
- it入门应该学什么 (55)
- java线上课程 (55)
- 学java的软件叫什么软件 (38)
- 程序开发软件有哪些 (53)
- 软件培训 (59)
- 机器人编程代码大全 (50)
- 少儿编程教程免费 (45)
- 新代系统编程教学 (61)
- 共创世界编程网站 (38)
- 亲测源码 (36)
- 三角函数积分公式表 (35)
- 函数的表示方法 (34)
- 表格乘法的公式怎么设置 (34)
- sumif函数的例子 (34)
- 图片素材 (36)
