4. What data type does the type() function return for the following?
type()
x = (1, 2, 3)
print(type(x))
<class 'set'>
<class 'list'>
<class 'tuple'>
<class 'dict'>
9. What will be the output of the following?x = Noneprint(type(x))
None
<class 'NoneType'>
<class 'void'>
<class 'null'>
5. What is the output of the following?x = 3.14print(type(x))
<class 'double'>
<class 'int'>
<class 'float'>
<class 'decimal.Decimal'>
1. What is the correct way to declare a variable in Python?
x := 10
int x = 10
x = 10
10 = x
6. What will be the result of bool([])?
bool([])
False
True
Error
3. Which of the following is a mutable data type in Python?
String
Integer
Tuple
List
8. What is the correct way to assign multiple variables in Python?
a, b, c = 1, 2, 3
a = b = c = 1, 2, 3
a = (1, 2, 3)
set a = 1, set b = 2, set c = 3
2. What will be the output of the following code?
x = "5"
y = 2
print(x * y)
7
55
10
TypeError
7. How do you convert a string to an integer in Python?
str(123)
float("123")
convert("123", int)
int("123")
10. Which of the following is an immutable data type?
Set
Dictionary