Week 2 Flashcards

1
Q

What are assignment statements

A

Assignment statements use the assignment operator ‘=’ to define variables

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

What do you need to define a variable?

A
  • The name of the variable
  • The initial value of the variable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some invalid variable names?

A
  • Starts with a number
  • Contains a space
  • Is a reserved word
  • Contains symbols (other than _ )
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are python arithmetic operations?

A

+, -, /, *
also powers= **
Floor division (ignores the fractional part) = //
Modulo division (remeainder)= %

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

List python data types

A
  • Integer
  • Float
  • String
  • Complex numbers
  • Boolean
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define integer

A

Whole numbers

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

Define float

A

Decimal numbers

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

Define string

A

sequence of characters

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

Define complex numbers

A

A number with a real and imaginary part

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

Define boolean

A

Two possible values: True or False

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

Is python dynamically typed or statically typed?

A

Dynamically typed

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

What are constants

A

Constants are variables whose value does not change after it has been assigned an initial value. Python does not enforce constants but it is good programming practice to use all CAPS for variables that should be treated as constants.

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

What is the None data type?

A

The None data type is Pythons version of null or no value. It is not zero, false or an empty string. It is a special data type: NoneType.

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