R4RIN
Articles
Java 8
MCQS
Python MCQ Quiz Hub
Python MCQS - Data type in python
Choose a topic to test your knowledge and improve your Python skills
1. Which of the following is the data type possible in python?
int
list
dictionary
All of the above
2. Which of the following is not the data type in python ?
List
Tuple
Set
Class
3. If we change one data type to another, then it is called
Type conversion
Type casting
Both of the above
None of the above
4. What is type casting in python ?
declaration of data type
destroy data type
Change data type property
None of the above
5. Which of the following is the example of the type casting ?
int(2)
str(2)
str(list)
All of the above
6. What is list data type in Python ?
collection of integer number
collection of string
collection of same data type
collection of different data type
7. Which of the following is the list in python ?
l=[]
l=list()
l=[1,2,3]
All
8. Empty list in python is made by ?
l=[]
l=list()
Both of the above
None of the above
9. Which of the sequence are valid in the set data type in python ?
1,1,1,1,1,1
2,3,4,5,6,1,2
1,2,3,4,5,6
None of the above
10. In which of the following data type, duplicate items are not allowed ?
list
set
dictionary
None of the above
11. How we can convert the given list into the set ?
list.set()
set.list()
set(list)
None of the above
12. In which data type, indexing is not valid ?
list
string
dictionary
None of the above
13. l=[1,2,3,4], then l[3] is ?
1
2
3
4
14. l=[1,2,3,4], then l[-2] is ?
1
2
3
4
15. l=[9,3,7,6,1,2,0], then l[100] is
2
9
6
Error
16. If we try to access the item outside the list index, then what type of error it may give ?
List is not defined
List index out of range
List index out of bound
No error
17. Which of the following can convert the string to float number ?
str(float,x)
float(str,int)
int(float(str))
float(str)
18. x=3.123, then int(x) will give
3.1
0
1
3
19. l=[1,2,3,4,8,1.2], which type of data type is this ?
set
list
tuple
integer
20. which of the following function are used to convert the string into the list ?
map()
convertor()
split()
lambda
Submit