Midterm Study Flashcards

1
Q

Bool

A

returns True/False

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

String

A

sequence of characters in parantheses “Word”

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

Float

A

Any number, can include decimals

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

Int

A

Integer values

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

Inequality

A

!=

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

equality

A

==

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

less than or equal

A

<=

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

greater than or equal

A

<=

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

exponentiation

A

**

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

returns length of input

A

len

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

returns largest item in the input

A

max

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

returns smalles item from its input

A

min

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

and

A

evaluates to True if both operands are True

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

or

A

evaluates to True if either operand is true

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

not

A

evaluates to the negation of the operant (ie not True evaluates to False)

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

‘hello’[0]

A

evaluates to h

17
Q

‘hello’[-1]

A

evaluates to o

18
Q

[a:b:c]

A

count in increments of c by starting at a and going up to, but not including, b

19
Q

in

A

evaluates true if the first string is a substring of the second

20
Q

not in

A

evaluates true if the first string is not a substring of the second.

21
Q

Enumerations

A

Grade = Enum(‘grade’, [“A”, “B”, “C”]

22
Q

How do you write and if/else statement

A

if n > x:
return
elif n<b:
return
else: