4.4 Flashcards

1
Q

What do you use the type() function for?

A

to know the type of the variable

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

_____ are reserved memory locations to store values.

A

variables

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

if you assign a value 5 to var then the type of the variable will be _______.

A

integer

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

T or F: python displays the variable type based on the value assigned to it.

A

true

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

A ______ is a basic element that a program works with, such as number or letter.

A

Value

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

if you assign ‘python is fun’ to a variable var, then the type will be ______.

A

string

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

T or F: python has 33 keywords reserved that cannot be used as a variable name.

A

true

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

name 4 basic variable types in python:

A
  1. integer. 2. string. 3. float. 4. boolean.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Name the type of variable:

It is real numbers expressed in decimal or scientific notation.

A

Float

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

Name the type of variable:

it is any logical true/false quantities.

A

boolean

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

Name the type of variable:

it is textual snippets comprising any number of character

A

string

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

Name the type of variable:

any positive, negative, or zero value.

A

integer

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

(operators/operands) are special symbols that represent computations like addition, subtraction, multiplication, and division.

A

operators.

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

_______ are the values the operator is applied.

A

operands.

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

T or F: when more than one operator appears in an expression, the order of evaluation depends on the rules of precedence.

A

true

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

T or F: exponentiation has the highest precedence

A

false, parenthesis.

17
Q

name at least 5 words that cannot be used as a variable name.

A

and, for, while, true, assert, del, raise, def, as, try, from, none, not, break, or, if, else, pass, is, with, class, in, continue, elif, finally, yield, lambda, return, import, global, and nonlocal.