Programming Concepts 003 Flashcards

1
Q

What is modulo?

A

Division that returns the the remainder after the operation

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

What symbol represents modulo?

A

% (E.g. 5 % 2 = 1)

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

What is integer division?

A

Division that returns a rounded down result

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

What symbol represents integer division?

A

// (E.g. 5 // 2 = 2)

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

What would 5/2 return in python?

A

2.5

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

What is a unary operator?

A

An operator that sits directly next to a variable & changes it’s negativity (E.g. if x = 5, -x = -5, and vice versa). These are limited to + and -

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

What is a bitwise operator?

A

An operator that works on the binary attribute of a number (E.g. The representation of 50 in binary is: “00110010” (x) and 19 is “00010011” (y). x & y is 00010010, or 18).

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

How do you turn an integer into binary in python?

A

:08b suffix (E.g. if x = 100, x:08b = 01100100).

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

How do you type “equal to” in python?

A

==

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

How do you type “not equal to” in python?

A

!=

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

How do you type greater and less than in python?

A

< & >

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

How do you type greater than or equal to and less than or equal to in python?

A

<= & >=

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