#### Search Tutorials

Python Data Types MCQ Questions and Answers | JavaInUse

# Python Data Types MCQ Questions and Answers

A. Integer
B. Float
C. String
D. Boolean

A. Integer
B. Float
C. String
D. List

A. Integer
B. List
C. Tuple
D. Dictionary

A. Integer
B. Float
C. String
D. Boolean

A. Integer
B. Dictionary
C. Set
D. Tuple

A. Integer
B. List
C. Tuple
D. Set

A. Integer
B. Float
C. String
D. Boolean

A. Integer
B. Float
C. String
D. Boolean

A. Integer
B. List
C. Tuple
D. Set

A. Integer
B. Float
C. String

A. Integer
B. Float
C. String
D. Boolean

A. Integer
B. List
C. Tuple
D. Set

## Q. What is the data type of the keys in a dictionary?

```def calculate_average(numbers):
total = sum(numbers)
average = total / len(numbers)
return average

numbers = [1, 2, 3, 4, 5]
avg = calculate_average(numbers)
print(avg)
```
A. Only integers
B. Only strings
C. Either integers or strings
D. Any data type

## Q. What is the data type of the result of the expression (1, 2) * 2?

A. Integer
B. Tuple
C. List
D. Error (cannot be multiplied)

A. Integer
B. Float
C. String
D. Boolean

## Q. What is the data type of the following value: "Python is a versatile programming language."

A. `int`
B. `float`
C. `str`
D. `list`

## Q. What will be the output of the following code snippet?

```my_variable = True
print(type(my_variable))
```
`int`
`float`
`str`
`bool`

`tuple`
`set`
`dict`
`list`

## Q. What will be the output of the following code snippet?

```my_list = [1, 2, 3, 4, 5]
my_tuple = ("a", "b", "c", "d", "e")
print(type(my_list))
print(type(my_tuple))
```
`<class 'int'>` and `<class 'str'>`
`<class 'list'>` and `<class 'tuple'>`
`<class 'float'>` and `<class 'str'>`
`<class 'tuple'>` and `<class 'list'>`

`int`
`dict`
`list`
`tuple`

## Q. What will be the output of the following code snippet?

```my_dict = {"a": 1, "b": 2, "c": 3}
print(type(my_dict))
```
`int`
`dict`
`list`
`str`

`set`
`list`
`dict`
`tuple`

## Q. What will be the output of the following code snippet?

```my_set = {1, 2, 3, 3, 4, 5}
print(my_set)
```
`{1, 2, 3}`
`{1, 2, 3, 3, 4, 5}`
`{1, 2, 3, 4, 5}`
`{3, 2, 5, 4, 1}`

`int`
`float`
`str`
`bool`

## Q. What will be the output of the following code snippet?

```my_float = 3.14
print(type(my_float))
```
`int`
`float`
`str`
`bool`