Variables Flashcards

1
Q

What is the purpose of variables?

A

To store a value

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

What are data types?

A

It describes what type of information is being stored.

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

What are variable declarations?

A

It is when you create a variable and assign it a value.

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

Should quotation marks be used when printing a variable?

A

No

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

When naming a variable, what must you start with?

A

Letter or underscore

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

Are variables case sensitive?

A

Yes. Variable, variable and, VARIABLE are all different variables.

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

Name some python key words. These words are not allowed to cannot be used as variables.

A
and, as, assert
break, class, continue,
del, elif, else,
except, FALSE, finally,
for, from, global,
if, import, is,
lambda, None, nonlocal
nont, or, pass, 
raise, return, TRUE,
try, while, with
yield
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What happens if you write:
my_variable = “Hello world”
my_variable = “Goodbye world”

A

The second line overwrites the first line. So my_variable value is Goodbye world.

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

What are string variables

A

It is a collection of text, numbers of symbols

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

What do Boolean values represent?

A

True or false statements

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

Boolean values are case sensitive, do they need to be uppercase or lowercase?

A

Uppercase

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

When printing an number, what do you use as a variable?

A

interger_variable

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

What should you avoid when typing intergers?

A

Commas

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

When is a float variable used?

A

When there is a decimal

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