Advance Python Quiz 1
Advance Python Quiz 1
CLASS :
Advanced Python Quiz Grade X
DATE :
45 Questions
a) [32,17,23,41,10] b) [17,23,41,10,32]
c) [10,17,23,32,41] d) [41,32,23,17,10]
7. Suppose list=[12,3,22,"mago","hello"], what is list[-6]
a) Error b) None
c) mango d) 12
8. L_names=['Harsh','Amit','Sahil','Viresh']min(L_names)
a) 'Harsh' b) 'Amit'
c) 'Viresh' d) None of the above
9. L_names=['Harsh','Amit','Sahil','Viresh']L_names.pop()
a) 'Harsh' b) 'Amit'
c) 'Viresh' d) None of the above
a) [2,4,8,16,32,64] b) [2,4,8,16][32,64]
c) [2,4,8,16],[32,64] d) None of the above
a) True b) False
a) [2,4] b) [2,4,8]
c) 2,4 d) None of the above
a) list1.remove(“hello”) b) list1.remove(hello)
c) list.remove(“hello”) d) list.remove(hello)
15. Identify the data type of T:
T = [‘A’, ‘23’, ‘92’, ‘(10,20)’]
a) List b) Dictionary
c) String d) Tuple
a) 33 55 22 b) 335522
a) A list may contain any type of object except b) A given object may appear in a list more
another list than once
c) All elements in a list must be of the same d) These represent the same list:['a', 'b', 'c']['c',
type 'a', 'b']
e) There is no conceptual limit to the size of a
list
a) a[2] = [] b) a[2:2] = []
c) del a[2] d) a.remove(3)
a) count( ) b) nd( )
c) len( ) d) index( )
a) -2 b) 8
c) 4 d) 6
a) [35,10,20,30,40,50] b) [10,20,30,40,50,35]
c) [10,20,35,40,50] d) [10,35,30,40,50]
a) nameList = John, Harry, Jesse, John, Harry, b) nameList = ("John", "Harry", "Jesse", "John",
Harry "Harry", "Harry")
c) nameList = ["John", "Harry", "Jesse", "John", d) nameList = [John, Harry, Jesse, John, Harry,
"Harry", "Harry"] Harry]
a) nameList(1) b) nameList[4]
c) nameList(4) d) nameList["1"]
a) List and tuples both are mutable. b) List is mutable whereas tuples are
immutable.
c) List and tuples both are immutable. d) List is immutable whereas tuples are
mutable
28. Can lists contain tuples and vice versa?
a) Yes b) No
a) PYT b) Pyt
c) Tho d) noh
a) Strings b) Numerics
c) Variable d) Tuple
a) Float b) Integer
c) Complex d) None of the above
35. ______ data types store values of more than one data type
a) List b) Tuple
c) Float d) Dictionary
36. Choose the immutable data type.
a) Tuples b) List
c) Set d) Dictionaries
a) Yes b) No
a) True b) False
a) / b) +
c) () d) -
a) my-var b) my_var
c) Myvar d) _myvar
41. How do you create a variable with the oating number 2.8?
a) x = 2.8 b) x = oat(2.8)
c) Both the other answers are correct
a) print(typeof(x)) b) print(typeOf(x))
c) print(type(x)) d) print(typeof x)
a) == b) <>
c) >< d) =
44. How do you start writing an if statement in Python?
a) my_string_1 b) b) 1st_string
c) foo d) _
Answer Key
1. c 13. c 25. c 37. a
2. b 14. a 26. b 38. b
3. b 15. a 27. b 39. c
4. a,c 16. d 28. a 40. a
5. d 17. b,e 29. b 41. c
6. b 18. c,d 30. a 42. c
7. a 19. d 31. c 43. a
8. b 20. t = ('foo',) 32. c 44. a
9. c 21. c 33. a 45. b
10. a 22. b 34. b
11. a 23. d 35. a,b,d
12. a 24. c 36. a