Python Commands Flashcards

1
Q

\f

A

ASCII Formfeed (FF)

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

+=

A

add what’s to the right, then set equal to what’s on the left

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

\b

A

ASCII Backspace (BS)

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

raw_input()

A

accepts input from the user

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

open()

A

opens a particular file, making the data it contains accessible to work with (must be assigned to a variable)

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

%r

A

formatter used for debugging

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

seek()

A

allows you to jump to a certain area within a file

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

>=

A

greater than or equal

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

%d

A

formatter that indicates a decimal number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
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
6
Q

\

A

slash character

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

*

A

asterisk

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

read()

A

can take an opened file and interpret the text it contains, which can then be printed

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

sys

A

a library built into python

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

\a

A

ASCII Bell (BEL)

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

\N

A

character named in the unicode database (unicode only)

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

<

A

less than

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

+

A

plus

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

\ooo

A

Character with octal value ooo

16
Q

%

A

percent - allows you to specify which values your formatters refer to

17
Q

#

A

turns line into a comment

19
Q

\t

A

tab character

19
Q

"

A

double quote

21
Q

print

A

displays text on the screen

22
Q

=

A

sets a variable

24
Q

\v

A

ASCII vertical tab (VT)

25
Q

trucate()

A

clears out all text from a file

27
Q

*args

A

allows you to set a series of args to a function

28
Q

”””

A

indicates a multi-line quote

29
Q

-

A

minus

30
Q

write()

A

writes text to an open file

32
Q

close()

A

closes and saves the file

33
Q

\r ASCII

A

Carriage Return (CR)

34
Q
A

less than or equal

35
Q

'

A

single quote

35
Q

os.path

A

a library built into python

36
Q

def

A

declares a function

37
Q

” or ‘

A

surrounds a string or line of text

39
Q

python -m pydoc [command]

A

displays the help page for a particular command

40
Q

/

A

slash

41
Q

\n

A

indicates a new line

41
Q

argv

A

a variable that accepts commands from the command line input

42
Q

exists

A

a command within os.path that determines whether a file exists or not

44
Q

>

A

greater than

45
Q

%s

A

formatter indicating a string

47
Q

‘w’/’r’/’a’

A

read, write, and append attributes to be applied when opening a file

48
Q

\xhh

A

Character with hex value hh

49
Q

from [library] import [argument]

A

imports certain commands from python libraries