Keywords Flashcards

(31 cards)

1
Q

and

A

Logical and

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

as

A

Part of the with-as statement

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

assert

A

Assert (ensure) that something is true

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

break

A

Stop this loop right now

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

class

A

Define a class

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

continue

A

Don’t process more of the loop, go back to the top and run it again

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

def

A

Define a function

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

del

A

Delete from dictionary

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

elif

A

Else if condition

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

else

A

Else condition

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

except

A

If an exception happens, do this

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

exec

A

Run a string as Python

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

finally

A

Exceptions or not, finally do this no matter what

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

for

A

Loop over a collection of things

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

from

A

Import specific parts of module

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

global

A

Declare that you want a global variable

17
Q

if

18
Q

import

A

Import a module (function) into this one to use

19
Q

in

A

Part of the for-loops. Also a test of X in Y

20
Q

is

A

Like == to test equality. More rigorous

21
Q

lambda

A

Create a short anonymus function

22
Q

not

23
Q

or

24
Q

pass

A

This block is empty

25
print
Print this string
26
raise
Raise an exception when things go wrong
27
return
Exit the function with a return value
28
try
Try this block, and if exception, go to except
29
while
While loop
30
with
With an expression as a variable do
31
yield
Pause here and return to caller