Variable Types Flashcards

(12 cards)

1
Q

Variable

A

Variables are nothing but reserved memory locations to store values.

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

Assignment Operator

A

( = ) . The operand to the left of the ( = ) operator is the name of the variable and the operand to the right of the ( = ) operator is the value stored in the variable.

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

The Five Standard Data Types

A

Numbers, String, List, Tuple, Dictionary

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

The Four Numerical Data Types

A

int, long, float, complex

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

A Complex Number

A

A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are the real numbers and j is the imaginary unit.

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

Strings

A

Strings in Python are identified as a contiguous set of characters represented in quotation marks

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

Slice Operator

A

( [ ] ),( [ : ] ). Subsets of strings can be taken using the slice operator ( [ ] ) and ( [ : ] ) with indexes starting at 0 in the beginning of the string and working their way from -1 at the end of the string.

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

String Concatenation Operator

A

( + ). Used to concatenate one or more strings.

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

Repetition Operator

A

( * ). Used to duplicate a string by an integer value.

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

Lists

A

A list contains items separated by commas and enclosed within square brackets ( [ ] ). A list may contain items belonging to different data types.

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

Tuples

A

A tuple is a sequence data type that is similar to a list but enclosed in parenthesis ( ( ) ). Tuples are an immutable data type (cannot change once defined). Tuples can be thought of as a read only list.

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

Dictionaries

A

A dictionary is a collection which is unordered, mutable, and indexed using (key,value) pairs. Dictionaries are enclosed with curly bracketed ( { } ).

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