Python Built-ins Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Value, returned by a logical operation or directly assigned.

这是一个值,由一种逻辑操作或直接分配返回得到的。

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Value used when representing the absence of a value or to initialize a variable which will be changed later. Returned by functions which do not explicitly return a value.
这是一个值,表示缺少一个值时使用它,或者用这个值初始化一个稍后要变更的变量时使用它。它是由不明确返回一个值的函数来返回的。

A

None

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Value, returned by a logical operation.

这是一个值,由一种逻辑操作返回的值。

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
Constant, show module name. If it's not "\_\_main\_\_", the code is being used in an import.
连续的,显示模块名字。如果它不是”\_\_main\_\_”的话,代码一直用在一项import里。
A

__name__

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List attributes of an item.

列出一个项目的所有属性。

A

dir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Iterate through a sequence and number each item.

迭代一个序列和每项数字。

A

enumerate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Exit Python (Command Line) interpreter.
退出Python(命令行)解释器。
A

exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Convert a number into a decimal, usually so that division works properly.
转换一个数字到一种小数形式,通常除法正确地有效。

A

float

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Get an attribute of an object by a name. Useful for introspection.
通过名字来得到一个对象的属性。对于反省是有用的。

A

getattr

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Get Python docstring on object.

得到目标的Python文档字符串。

A

help

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Show the location in the computer’s RAM where an object is stored.
显示计算机RAM的位置,该位置是存储目标的内存位置。

A

id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Convert a string into an integer number.

转换一个字符串到一个整数。

A

int

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Get the number of elements in a sequence.

在一个序列中得到元素的数量。

A

len

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A base on which other classes can inherit from.

一个根据其它类继承过来基础。

A

object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Open a file on disk, return a file object.

在磁盘上打开一个文件,返回一个文件对象。

A

open

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Reimplementation of print keyword, but as a function. Need to import from the future to use it.
重新部署了print关键字,但变成了一个函数。需要从下一步使用它来导入。

A

print

17
Q

Gives numbers between the lower and upper limits specified (including the lower, but excluding the upper limit). A step may be specified.
从小到大给出一些由描述决定的数字(包含较小的数字,但不包含较大的数字)。可以描述一个步幅。

A

range

18
Q

Get some text as a string from the user, with an optional prompt.
从用户那得到的文本变成字符串,可以含有一个可选提示内容。

A

raw_input

19
Q

Convert an object (usually a number) into a string (usually for printing).
转换一个目标(通常是一个数字)到一个字符串(通常为了打印)。

A

str

20
Q

Give the type of the specified object.

给出描述对象的类型。

A

type