Python Built-in Functions Flashcards

1
Q

abs()

A

Returns the absolute value of a number

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

all()

A

Returns True if all items in an iterable object are true

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

any()

A

Returns True if any item in an iterable object is true

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

ascii()

A

Returns a readable version of an object. Replaces none-ascii characters with escape character

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

bin()

A

Returns the binary version of a number

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

bool()

A

Returns the boolean value of the specified object

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

bytearray()

A

Returns an array of bytes

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

bytes()

A

Returns a bytes object

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

callable()

A

Returns True if the specified object is callable, otherwise False

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

chr()

A

Returns a character from the specified Unicode code.

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

classmethod()

A

Converts a method into a class method

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

compile()

A

Returns the specified source as an object, ready to be executed

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

complex()

A

Returns a complex number

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

delattr()

A

Deletes the specified attribute (property or method) from the specified object

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

dict()

A

Returns a dictionary (Array)

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

dir()

A

Returns a list of the specified object’s properties and methods

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

divmod()

A

Returns the quotient and the remainder when argument1 is divided by argument2

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

enumerate()

A

Takes a collection (e.g. a tuple) and returns it as an enumerate object

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

eval()

A

Evaluates and executes an expression

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

exec()

A

Executes the specified code (or object)

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

filter()

A

Use a filter function to exclude items in an iterable object

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

float()

A

Returns a floating point number

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

format()

A

Formats a specified value

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

frozenset()

A

Returns a frozenset object

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

getattr()

A

Returns the value of the specified attribute (property or method)

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

globals()

A

Returns the current global symbol table as a dictionary

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

hasattr()

A

Returns True if the specified object has the specified attribute (property/method)

28
Q

hash()

A

Returns the hash value of a specified object

29
Q

help()

A

Executes the built-in help system

30
Q

hex()

A

Converts a number into a hexadecimal value

31
Q

id()

A

Returns the id of an object

32
Q

input()

A

Allowing user input

33
Q

int()

A

Returns an integer number

34
Q

isinstance()

A

Returns True if a specified object is an instance of a specified object

35
Q

issubclass()

A

Returns True if a specified class is a subclass of a specified object

36
Q

iter()

A

Returns an iterator object

37
Q

len()

A

Returns the length of an object

38
Q

list()

A

Returns a list

39
Q

locals()

A

Returns an updated dictionary of the current local symbol table

40
Q

map()

A

Returns the specified iterator with the specified function applied to each item

41
Q

max()

A

Returns the largest item in an iterable

42
Q

memoryview()

A

Returns a memory view object

43
Q

min()

A

Returns the smallest item in an iterable

44
Q

next()

A

Returns the next item in an iterable

45
Q

object()

A

Returns a new object

46
Q

oct()

A

Converts a number into an octal

47
Q

open()

A

Opens a file and returns a file object

48
Q

ord()

A

Convert an integer representing the Unicode of the specified character

49
Q

pow()

A

Returns the value of x to the power of y

50
Q

print()

A

Prints to the standard output device

51
Q

property()

A

Gets, sets, deletes a property

52
Q

range()

A

Returns a sequence of numbers, starting from 0 and increments by 1 (by default)

53
Q

repr()

A

Returns a readable version of an object

54
Q

reversed()

A

Returns a reversed iterator

55
Q

round()

A

Rounds a numbers

56
Q

set()

A

Returns a new set object

57
Q

setattr()

A

Sets an attribute (property/method) of an object

58
Q

slice()

A

Returns a slice object

59
Q

sorted()

A

Returns a sorted list

60
Q

staticmethod()

A

Converts a method into a static method

61
Q

str()

A

Returns a string object

62
Q

sum()

A

Sums the items of an iterator

63
Q

super()

A

Returns an object that represents the parent class

64
Q

tuple()

A

Returns a tuple

65
Q

type()

A

Returns the type of an object

66
Q

vars()

A

Returns the __dict__ property of an object

67
Q

zip()

A

Returns an iterator, from two or more iterators