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