Professional Documents
Culture Documents
(a) Numeric
(b) None
(c) Mappings
(d) list
(e) Sequence
(f) set
(g) tuple
(h) dictionary
(a) Integer
(b) Boolean
(c) complex
(d) floating point
(e) list
(f) None
a = 35
m=a
Following the execution of these statements, Python has created how many
objects and how many references ?
(a) identity()
(b) .id()
(c) refnum()
(d) ref()
5 The operator used to check if both the operands reference the same object
memory, is the _____ operator.
(a) in
(b) is
(c) id
(d) ==
6. For two objects and y, the expression x is y will yield True, if and only if
(a) String
(b) Tuples
(c) Set
(d) dictionary
(a) integer
(b) floating point
(c) complex
(d) all of these
(a) 4
(b) 4.0
(c) 2.5
(d) none of these
(a) 4
(b) 4.0
(c) 2.5
(d) none of these
(a) True
(b) False
(c) Only in Functions
(d) Only in modules
12. In Python, a variable is assigned a value of one type, and then later assigned
a value of different type. This will yield _____.
(a) Warning
(b) Error
(c) None
(d) No Error
13. In Python, a variable may be assigned a value of one type, and then later
assigned a value of a different type. This concept is known as _____.
(a) mutability
(b) static typing
(c) dynamic typing
(d) immutability
14. Is it safe to directly use the == operator to determine whether objects of type
float are equal ?
(a) Yes
(b) No
(c) Yes, if the values are <100
(d) Yes, if the values are >100
a = 8.6
b=2
print (a//b)
(a) 4.3
(b) 0
(c) 4
(d) compilation
(a) Operands
(b) Expression
(c) operators
(d) Equation
18. What will be the value of y after following code fragment is executed ?
x = 10.0
y = (x < 100.0) and x >=18
(a) 110
(b) True
(c) False
(d) Error
(a) 0.000001
(b) "None
(c) 0
(d) []
(e) False
(f) True
(g) 1
(h) 33
(i) None
(j) 0.0
import math
x = 100
print (x > 0 and math.sqrt(x))
(a) True
(b) 1
(c) 10
(d) 10.0
(a) not
(b) %
(c) and
(d) +
(e) **
(a) 28
(b) 739
(c) 829
(d) 64
23. To increase the value of x five times using augmented assignment operator,
the correct expression will be
(a) x += 5
(b) x *= 5
(c) x = x ** 5
(d) none of these
(a) 0
(b) 1
(c) 10
(d) 1.0
(a) 5
(b) 1
(c) 10
(d) 0
(a) 5
(b)1
(c) 10
(d) 0
(a) 5
(b)1
(c) 10
(d) 0
29. What will be the result of the expression „a‟ or „ ‟ („‟ is an empty string?
(a) „a‟
(b) “”
(c) 1
(d) 0
30. What will be the result of the expression and „ ‟ („‟ is an empty string?
(a) „a‟
(b) “”
(c) 1
(d) 0
31. What will be the result of the expression „x‟ and 'a' ?
(a) „a‟
(b) “”
(c) „x‟
(d) 1
32. What will be the result of the expression: „a‟ and 'x'?
(a) „a‟
(b) “”
(c) „x‟
(d) 1
33. What will be the result of the expression 'a' and „None‟?
(a) „a‟
(b) “”
(c) „None‟
(d) 1
34. What will be the result of the expression 'None' and „a‟?
(a) „a‟
(b) “”
(c) „None‟
(d) 1
35. What will be the result of the expression „false‟ and False ?
(a) false
(b) False
(c) 'false'
(d) “False”
(a) false
(b) False
(c) 'false'
(d) “False”
Answer :-
2. Two forms of floating-point numbers are _____ form and _____ notation.
10. To check if two objects reference the same memory address, _____ operator
is used.
Answer :-
1. Integer
2. fractional, exponent
3. 15
4. lists, dictionaries, sets
5. integer
6. floating-point
7. set
8. tuple
9. id
10. is
11. math
12. Explicit
18. Two floating point numbers should not be compared for equality using ==.
19. In implicit conversion, all operands' data types are converted to the data type of the
largest operand.
20. Explicit type conversion involves the use of a function to convert data type of a
value.
Answer :-
1. False
2. True
3. False
4. True
5. True
6. False
7. False
8. True
9. True
10. True
11. False
12. True
13. False
14. True
15. False
16. False
17. True
18. True
19. True
20. True