Lecture 3 Flashcards

1
Q

=

A

Is the assignment operator and is not an = as we used it in mathematics. For example i=i+5 is valid

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

+

A

Addition

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

-

A

Subtraction

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

*

A

Multiplication

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

/

A

Division

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

//

A

Floor division

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

%

A

Modulus (remainder)

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

**

A

Exponentiation

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

-

A

Unary minus

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

+

A

Unary plu

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

What type of variable will division return?

A

A float

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

()

A

Parentheses

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

+x , -x

A

Unary plus/minus

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

Is and is not

A

Our identity operators, and check the memory location of two variables. They do not compare values.

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

In and not in

A

Our membership operators and check if a character is in a string

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

&

19
Q

~

A

Not (bit inversion)

20
Q

«

A

Left shift

21
Q

> >

A

Right shift

22
Q

Conditionals definition

A

Conditionals or construct in programming languages that control the flow of a program based on whether a condition is true or false

23
Q

If statement

A

Executes code only if the statement is true

24
Q

None

A

Has no value and it of the type Nonetype

25
Q

Else

A

The L statement is used to execute a certain block of code if and only if the proceeding if statement condition is false.

26
Q

Elif

A

The elifstatement is used to execute a certain block of code if and only if the proceeding if statement condition is false, and the elf condition is true.