Data types Flashcards

1
Q

What are the two main categories of data types?

A

Primitive data types and composite data types.

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

True or False: An integer is a primitive data type.

A

True.

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

Fill in the blank: A _______ data type can hold multiple values.

A

composite

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

What data type would you use to represent true or false values?

A

Boolean.

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

Which data type is typically used for textual data?

A

String.

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

What is an example of a composite data type?

A

Array or Object.

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

Multiple choice: Which of the following is NOT a primitive data type? A) String B) Integer C) Boolean D) Array

A

D) Array.

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

True or False: Floating-point numbers can represent decimal values.

A

True.

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

What is the purpose of a data type?

A

To define the kind of value a variable can hold.

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

Fill in the blank: In programming, the _______ data type represents a single character.

A

char

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

Multiple choice: Which data type would you use to store a list of items? A) String B) Array C) Boolean D) Float

A

B) Array.

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

What is the difference between a float and a double?

A

A float has single precision, while a double has double precision.

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

True or False: A variable of type ‘String’ can only hold a single character.

A

False.

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

What data type would you use to represent a unique identifier?

A

UUID or String.

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

Fill in the blank: The _______ data type is used to represent whole numbers.

A

Integer

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

Multiple choice: Which of the following is a valid data type in Python? A) String B) Integer C) List D) All of the above

A

D) All of the above.

17
Q

What is a ‘null’ data type?

A

It represents the absence of a value.

18
Q

True or False: Composite data types can only contain primitive data types.

19
Q

What data type would you use for currency values?

A

Decimal or Float.

20
Q

Fill in the blank: A _______ is a collection of key-value pairs.

A

dictionary

21
Q

Multiple choice: Which one of these is NOT a characteristic of primitive data types? A) They cannot be broken down further B) They have a fixed size C) They can be modified D) They are predefined

A

C) They can be modified.

22
Q

What is the range of values for an 8-bit unsigned integer?

23
Q

True or False: Strings are mutable in all programming languages.

24
Q

What is the purpose of type casting?

A

To convert one data type into another.

25
Q

Fill in the blank: A _______ is a sequence of characters enclosed in quotes.

26
Q

Multiple choice: Which data type would you use to store a collection of unique items? A) Array B) Set C) List D) String

27
Q

What data type is often used to represent dates and times?

A

Date or DateTime.