Python - Data Types Flashcards

Review Major Concepts of Data Type in the Python Programming Language

1
Q

Research: what is a Data Type in the Python Programming Language.

A

Data values in Python are known as objects; each object, aka value, has a type.

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

List and Describe: each Data Type in the Python Programming Language.

A

Numbers
Sequences
Sets
Dictionaries
None
Ellipsis (…)
Callables
Boolean Values

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

What are the three built-in types that are numerical data types?

A

The built-in numeric types in Python include integers, floating-point numbers, and complex numbers.

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

List and Describe: the four Integers literals of the numerical data types.

A

Decimal
A decimal literal is a sequence of digits in which the first digit is nonzero.

Binary
A binary literal is 0b followed by a sequence of binary digits (0 or 1).

Octal
An octal literal is 0o followed by a sequence of octal digits (0 to 7).

Hexadecimal
hexadecimal literal is 0x followed by a sequence of hexadecimal digits (0 to 9 and A to F, in either upper- or lowercase).

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

Describe: floating-point literals of the numerical data types.

A

A floating-point literal is a sequence of decimal digits that includes a decimal point (.), an exponent suffix (e or E, optionally followed by + or -, followed by one or more digits), or both.

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

Describe: Complex Number of the numerical data types.

A

A complex number is made up of two floating-point values, one each for the real and imaginary parts.

You can access the parts of a complex object z as read-only attributes z.real and z.imag.

Examples: 0j, 0.j, 0.0j, .0j, 1j, 1.j, 1.0j, 1e0j, 1.e0j, 1.0e0j

You can specify an imaginary literal as any floating-point or integer decimal literal followed by a j or J. The j at the end of the literal indicates the square root of -1, as commonly used in electrical engineering (some other disciplines use i for this purpose, but Python uses j).

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

A sequence is an ordered container of items, indexed by integers. Python has built-in sequence types known as strings (bytes or str), tuples, and lists.

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