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?

A

str[-1]

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?

A

str[::-1]

25
Q

x = [2, 4, 6, 8, 10]

a) reverse the list
b) start at the 6 and end at 10
c) take just 10

A

y = x[::-1]
y = x[2:]
y = x[4]

26
Q

Can the variable you’re naming start with a lowercase or uppercase letter?

A

yes

27
Q

Can your variable start with an underscore?

A

yes, (but not recommended)

28
Q

Can your variable name start with a number?

A

No

29
Q

Can your variable name contain numbers and underscores?

A

yes

30
Q

%, return what?

A

remainder

31
Q

// , returns what?

A

returns number without the reminder

32
Q

x = int(2.4)
print(x)

Output?

A

2

33
Q

x = int(‘2.4’)
print(x)

Output?

A

Error (can’t be string)

34
Q

x = float(‘2’)
print(x)

Output?

A

2.0 ( the string represents a number)

35
Q

x = float(‘andrea’)
print(x)

Output?

A

Error (the variable inside doesn’t represent a number)

36
Q

x = str(2.4)
print(x)

y = str(2)
print(y)

Output?

A

‘2.4’
‘2’

37
Q

0 and 0.0
True or False?

A

False

38
Q

Any other number, besides 0 and 0.0. Are they true or false?

A

True

39
Q

str(‘’)
true or false?

A

false

40
Q

x = [1, 2, 3, 4]
x.append(5)
print(x)

Output?

A

[1, 2, 3, 4, 5]

41
Q

x = [1, 2, 3, 4]
x.append(5)

y = [6, 7, 8, 9]
x += y
print(x)

Output?

A

[1, 2, 3, 4, 5, 6, 7, 8, 9]

42
Q

x = [1, 2, 3, 4]
x.pop(2)
print(x)

Output?

A

[1, 2, 4]

43
Q

x = [1, 2, 3, 4]
x.remove(1)
print(x)

Output?

A

[2, 3, 4]

44
Q

x = [1, 2, 3, 4]
x.insert(3,5)
print(x)

Output?

A

[1, 2, 3, 5, 4]

45
Q

x = [0, 1, 2, 3, 4]
print(len(x))

Output?

A

5

46
Q

x = [0, 1, 2, 3, 4]
print(x[-1])

Output?

A

4

47
Q

x = [0, 1, 2, 3, 4]
print(x[0:2])

A

[0, 1]