Font size
WorksheetsPython - Data Types
Total questions: 11
Worksheet time: 6mins
Which of the following are immutable
Number
String
Tuple
All of the above
What is true about complex numbers?
The real and imaginary component can be float
The real part should be an integer
Scientific notation cannot be used in complex number
All of above
The int() function can be useful to convert
string to integer
hexadecimal to integer
float to int
complex number to int
Which of the following is not a valid integer in Python?
0o123
123
0123
0x123
Which of the following are valid complex number objects?
4+5j
5j+4
0j
5+4
An Expression 'str' in 'string' will return
True
False
ValueError
TypeError
Which of these is not a core data type?
List
Tuple
Dictionary
Class
Which one of the following is False regarding data types in Python?
In python, explicit data type conversion is possible
Mutable data types are those that can be changed.
Immutable data types are those that cannot be changed.
None of the above
Which of the following function is used to know the data type of a variable in Python?
datatype()
typeof()
type()
vartype()
How to get the type of the following Variable?
Val = 12
type(Val)
exec(Val)
print(Val)
help(Val)
What is the output of the following code?
x = 25
type(x)
integer
int
<class 'int'>
<class 'number'>
