Python Keywords Flashcards

1
Q

and

A

A logical operator

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

as

A

To create an alias

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

assert

A

For debugging

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

break

A

To break out of a loop

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

class

A

To define a class

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

continue

A

To continue to the next iteration of a loop

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

def

A

To define a function

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

del

A

To delete an object

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

elif

A

Used in conditional statements, same as else if

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

else

A

Used in conditional statements

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

except

A

Used with exceptions, what to do when an exception occurs

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

False

A

Boolean value, result of comparison operations

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

finally

A

Used with exceptions, a block of code that will be executed no matter if there is an exception or not

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

for

A

To create a for loop

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

from

A

To import specific parts of a module

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

global

A

To declare a global variable

17
Q

if

A

To make a conditional statement

18
Q

import

A

To import a module

19
Q

in

A

To check if a value is present in a list, tuple, etc.

20
Q

is

A

To test if two variables are equal

21
Q

lambda

A

To create an anonymous function

22
Q

None

A

Represents a null value

23
Q

nonlocal

A

To declare a non-local variable

24
Q

not

A

A logical operator

25
Q

or

A

A logical operator

26
Q

pass

A

A null statement, a statement that will do nothing

27
Q

raise

A

To raise an exception

28
Q

return

A

To exit a function and return a value

29
Q

True

A

Boolean value, result of comparison operations

30
Q

try

A

To make a try…except statement

31
Q

while

A

To create a while loop

32
Q

with

A

Used to simplify exception handling

33
Q

yield

A

To return a list of values from a generator