Python Flashcards Preview

Programming > Python > Flashcards

Flashcards in Python Deck (31)
Loading flashcards...
0

\\

Single backslash

1

\'

Single quote

2

\"

Double quote

3

\a

ASCII bell (BEL)

4

\b

ASCII backspace (BS)

5

\f

ASCII formfeed (FF)

6

\n

ASCII linefeed (LF)

7

\N{name}

Character named name in the Unicode database (Unicode only)

8

\r ASCII

Carriage return (CR)

9

\t ASCII

Horizontal tab (TAB)

10

\uxxxx

Character with 16 bit hex value xxxx (Unicode only)

11

\Uxxxxxxxx

Character with 32 bit hex value xxxxxxxx (Unicode only)

12

\v

ASCII vertical tab (VT)

13

\ooo

Character with octal value ooo

14

\xhh

Character with hex value hh

15

class

Tell python to make a new kind of thing

16

object

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

17

instance

What you get when you tell python to create a class

18

def

How you define a function inside a class

19

self

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

20

inheritance

The concept that one class can inherit traits from another class

21

composition

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

22

attribute

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

23

is-a

A phrase to say that something inherits from another

24

has-a

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

25

classX(Y)

Make a class named X that is Y

26

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

Class X has a _init_ that takes self and J parameters

27

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

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

28

foo = X()

Set foo to an instance of class X

29

foo.M(J)

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

30

foo.K = Q

From foo get the K attribute and set it to Q