Words Flashcards

1
Q

Object

A

1) The most basic type of thing

2) Any instance of some thing

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

Instance

A

What you get when you tell Python to create a class

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

def

A

define a function

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

self

A

A variable inside the functions in a class for the instance/object being accessed

(For self-reference)

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

Inheritance

A

The concept that one class can inherit traits from another class

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

Composition

A

The concept hat one class can be composed of other classes as parts

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

attribute

A

A property classes have that are from composition. Usually variables

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

is-a

A

Inherits traits from

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

has-a

A

Is composed of

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

Class

A

Tell Python to create a new type of thing

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

#

A

Octothorpe. Used for comments that are not part of the code

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

print “X”

A

Displays whatever text is in quotes

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

String

A

Normal text inside quotes “ or ‘

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

%s

A

Format character. Use to insert variable

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

%r

A

Format character. Used to insert variable EXACTLY (raw)

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

round()

A

Rounds number in () to nearest whole

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

True and false

A

Used to tell code what is true or false. Also returned if the code is asked whether something is true or false

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

%

A

Formatter. Used to reference variables to insert

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

\n

A

New line character. Starts a new line within a string

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

\

A

Backslash. Escape character. Used within strings before character that might be mistaken by Python as code

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

raw_input()

A

Asks operator for input

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

from X import Y

A

Tells Python to import Y from library X

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

argv

A

Argument variable. Function in sys that holds the arguments passed through script

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

open

A

Opens a file

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

pydoc X

A

Displays manual page for command X

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

read

A

shows file. Result can be assigned to a variable

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

close

A

Closes file

28
Q

readline

A

Reads specific line of file

29
Q

truncate

A

Empties (deletes contents of) file

30
Q

write(‘X’)

A

Writes string X to file

31
Q

sys

A

Module containing basic Python functions

32
Q

os.path

A

Accesses files on operating system

33
Q

exists

A

Function in os.path that tells operator of a file exists or not

34
Q

=

A

Is

35
Q

return

A

Sets variables to be a value derived from the function

36
Q

Boolean

A

True or false

37
Q

if

A

Affects variables IF they fall under specifications

38
Q

elif

A

Affects variables under different specifications than if

39
Q

else

A

Effects variables that do not fall under the if or elif specifications

40
Q

list = [‘X’, Y, “Z”]

A

Creates a list of string X, number Y and string Z

41
Q

List

A

A list. Works in order of addition.

42
Q

while

A

Like if but allows for variables to be effected until they do not fall under while specifications

43
Q

index

A

address of an item, usually in a list. Starts at 0

44
Q

exit

A

Function from sys which breaks a loop

45
Q

assert

A

Ensure that something is true

46
Q

break

A

Stops loop

47
Q

del

A

Delete from dictionary

48
Q

except

A

Effects exceptions

49
Q

exec

A

Run a string as Python script

50
Q

finally

A

Effects variables last, exceptions or not

51
Q

in

A

Tells script where to look for things

52
Q

global

A

declares global variable

53
Q

is

A

Like == no o test equality

54
Q

==

A

Exactly absolutely equal to

55
Q

lambda

A

Create short, anonymous function

56
Q

raise

A

Raise an exception when things go wrong

57
Q

try

A

Tries a block. If exception, goes to except

58
Q

with X as Y

A

With and expression as a a variable

59
Q

yield

A

Pause here and return to caller

60
Q

float

A

Decimal number

61
Q

dictionary

A

Like a list, but pairs one thing to another- key:value. Order doesn’t matter. Placed inside {}

62
Q

append

A

Adds to a list

63
Q

join

A

Combines lists

64
Q

del

A

Deletes from dict

65
Q

Module

A

Python file with functions and/or variables in it

66
Q

Class

A

Mini-module. Container for functions and variables and other classes