Engr Final Flashcards

1
Q

==

A

equal

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

=

A

assigning

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

!=

A

does not equal too

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

<

A

less than

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

>

A

greater than

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

<=

A

less than or equal too

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

> =

A

greater than or equal too

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

and

A

both/all must be true

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

or

A

if any are true, whole thing is true

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

not

A

True becomes False; False becomes true

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

is

A

return true, if what is given is the same

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

is not

A

return true, if what is given is not the same

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

in

A

returns true, if what is given is in the date set

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

not in

A

returns true, if what is given is not in the data set

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

not (A and B)

A

((not A) or (not B))

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

not ( A or B)

A

((not A) or (not B))

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

How does the format slicing look like?

A

[x:y]

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

For slicing what is the starting index?

A

0

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

How does the format for slicing look like, when you wanna start at the end of the string?

20
Q

Slicing:

What does the format look like if you want to start from the beginning till the end?

A

str[0:] or str[:]

21
Q

Slicing:

What does the format look like if you want to end at certain spot?

A

str[:stop]

22
Q

Slicing:

What does the format look like if you want to start and end at a certain spot?

A

str[start:stop]

23
Q

Slicing:

what the does format look like when you only one character for the list?

A

str[num] or str[‘word’]

24
Q

Slicing:

What does the format look like if you want to reverse the string?

25
x = [2, 4, 6, 8, 10] a) reverse the list b) start at the 6 and end at 10 c) take just 10
y = x[::-1] y = x[2:] y = x[4]
26
Can the variable you're naming start with a lowercase or uppercase letter?
yes
27
Can your variable start with an underscore?
yes, (but not recommended)
28
Can your variable name start with a number?
No
29
Can your variable name contain numbers and underscores?
yes
30
%, return what?
remainder
31
// , returns what?
returns number without the reminder
32
x = int(2.4) print(x) Output?
2
33
x = int('2.4') print(x) Output?
Error (can't be string)
34
x = float('2') print(x) Output?
2.0 ( the string represents a number)
35
x = float('andrea') print(x) Output?
Error (the variable inside doesn't represent a number)
36
x = str(2.4) print(x) y = str(2) print(y) Output?
'2.4' '2'
37
0 and 0.0 True or False?
False
38
Any other number, besides 0 and 0.0. Are they true or false?
True
39
str('') true or false?
false
40
x = [1, 2, 3, 4] x.append(5) print(x) Output?
[1, 2, 3, 4, 5]
41
x = [1, 2, 3, 4] x.append(5) y = [6, 7, 8, 9] x += y print(x) Output?
[1, 2, 3, 4, 5, 6, 7, 8, 9]
42
x = [1, 2, 3, 4] x.pop(2) print(x) Output?
[1, 2, 4]
43
x = [1, 2, 3, 4] x.remove(1) print(x) Output?
[2, 3, 4]
44
x = [1, 2, 3, 4] x.insert(3,5) print(x) Output?
[1, 2, 3, 5, 4]
45
x = [0, 1, 2, 3, 4] print(len(x)) Output?
5
46
x = [0, 1, 2, 3, 4] print(x[-1]) Output?
4
47
x = [0, 1, 2, 3, 4] print(x[0:2])
[0, 1]