Python Flashcards

0
Q

'

A

Single quote

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

\

A

Single backslash

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

"

A

Double quote

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

\a

A

ASCII bell (BEL)

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

\b

A

ASCII backspace (BS)

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

\f

A

ASCII formfeed (FF)

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

\n

A

ASCII linefeed (LF)

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

\N{name}

A

Character named name in the Unicode database (Unicode only)

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

\r ASCII

A

Carriage return (CR)

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

\t ASCII

A

Horizontal tab (TAB)

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

\uxxxx

A

Character with 16 bit hex value xxxx (Unicode only)

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

\Uxxxxxxxx

A

Character with 32 bit hex value xxxxxxxx (Unicode only)

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

\v

A

ASCII vertical tab (VT)

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

\ooo

A

Character with octal value ooo

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

\xhh

A

Character with hex value hh

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

class

A

Tell python to make a new kind of thing

16
Q

object

A

The most basic kind of thing, and any instance of some thing

17
Q

instance

A

What you get when you tell python to create a class

18
Q

def

A

How you define a function inside a class

19
Q

self

A

Inside the functions in a class, self is a variable for the instance/object being accessed.

20
Q

inheritance

A

The concept that one class can inherit traits from another class

21
Q

composition

A

The concept that a class can be composed of other classes as parts

22
Q

attribute

A

A property classes have that are from composition and are usually variables.

23
Q

is-a

A

A phrase to say that something inherits from another

24
Q

has-a

A

A phrase to say that something is composed of other things or has a trait

25
Q

classX(Y)

A

Make a class named X that is Y

26
Q

class X (object): def init(self, J)

A

Class X has a init that takes self and J parameters

27
Q

class X(object): def M (self, J)

A

Class x has a function named M that takes self and J parameters.

28
Q

foo = X()

A

Set foo to an instance of class X

29
Q

foo.M(J)

A

From foo get the M function, and call it with parameters self, J

30
Q

foo.K = Q

A

From foo get the K attribute and set it to Q