O level Python MCQ questions and answers
In this blog you will get o level python (m3 r5) mcq
1. What is the data type of print(type(5))?
A. int
B. float
C. double
D. integer
2. Is Python case sensitive when dealing with identifiers?
A. Yes
B. No
C. machine dependent
D. none of the mentioned
3. Which of these in not a core data type?
A. Class
B. Lists
C. Tuples
D. Dictionary
4. What is the data type of print(type(0xFF))
A. int
B. hex
C. hexint
D. number
5. Which statement is correct?
A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable
6. Which one of the following is correct way of declaring and initialising a variable, x with value 5?
A. int x
x=5
B. int x=5
C. x=5
D. declare x=5
7. How we can convert the given list into the set ?
A. set.list()
B. list.set()
C. set(list)
D. None of the above
8. What is the maximum possible length of an identifier?
A. 31 characters
B. 63 characters
C. 79 characters
D. none of the mentioned
9. Why are local variable names beginning with an underscore discouraged?
A. they slow down execution
B. they confuse the interpreter
C. they are used to indicate global variables
D. they are used to indicate a private variables of a class
10. All keywords in Python are in
A. lower case
B. UPPER CASE
C. Capitalized
D. None of the mentioned
11. Which of the following is not a data type?
A. Numeric Data
B. Symbolic Data
C. Alphabetic Data
D. Alphanumeric Data
12. 19Ac8 is a type of ________________ data.
A. Symbolic
B. Alphabetic
C. Numeric
D. Alphanumeric
13. Which of the following statement is invalid?
A. x <- c(1+0i, 2+4i)
B. x <- c(T, F)
C. x <- c(TRUE, FALSE)
D. None of the mentioned
14. Which of the following will run without errors?
A. round()
B. round(45.8)
C. round(6352.898,2,5)
D. round(7463.123,2,1)
15. What dataype is the object below ?
L = [1, 23, ‘hello’, 1].
A. list
B. array
C. tuple
D. dictionary
16. Which is the correct approach of declaring and initialising a variable, ‘a’ with value 10?
A. a=10
B. int a=10
C. int a; a=10
D. declare a=10
17. Which of the following is invalid?
A. _a = 1
B. __a = 1
C. __str__ = 1
D. none of the mentioned
18. Which of the following is an invalid variable?
A. _
B. foo
C. 1st_string
D. my_string_1
19. Given a function that does not return any value, What value is thrown by default when executed in shell.
A. int
B. bool
C. void
D. none
20. What is the return type of function id?
A. int
B. float
C. bool
D. dict
21. In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:
A. True
B. False
22. What will be the output of statement 2**2**2**2
A. 16
B. 256
C. 32768
D. 65536
23. Which of the following statement is False?
A. Variable name can begin with number.
B. Variable names can be arbitrarily long.
C. Variable name can begin with underscore.
D. They can contain both letters and numbers.
24. Which of the following is incorrect regarding variables in Python?
A. Variable names can start with an underscore.
B. Data type of variable names should not be declared
C. Variable names in Python cannot start with number. However, it can contain number in any other position of variable name.
D. None of the above
25. All keyword in python are in
A. Lowercase
B. Uppercase
C. Both uppercase & Lowercase
D. None of the above
26. Which of the following is a valid variable?
A. var@
B. 32var
C. class
D. abc_a_c
27. Why are local variable names beginning with an underscore discouraged?
A. they slow down execution
B. they confuse the interpreter
C. they are used to indicate global variables
D. they are used to indicate a private variables of a class
28. Which of the following is not a keyword?
A. pass
B. eval
C. assert
D. nonlocal
29. What is the type of int?
A. float
B. integer
C. boolean
D. complex
30. What type of error can arises when you execute the following code x = y?
A. NameError
B. SyntaxError
C. TypeError
D. ValueError
Some Others o level python (m3 r5) mcq click on the below link
O Level Python mcq Online Test
31. To store values as regards key and value we use ___________.
A. class
B. tuple
C. list
D. dictionary
32. Can we use tuple as dictionary key?
A. True
B. False
33. Which of the following is not a valid representation in bits?
A. 8-bit
B. 24-bit
C. 32-bit
D. 64-bit
34. What are the entities whose values can be changed called?
A. Tokens
B. Modules
C. Variables
D. Constants
35. In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.
>>>x = 13 ? 2
objective is to make sure x has a integer value, select all that apply (python 3.xx)
A. x = 13 // 2
B. x = 13 % 2
C. x = int(13 / 2)
D. All of the mentioned
36. Which of the following results in a SyntaxError?
A. ‘3\’
B. ”’That’s okay”’
C. “He said, ‘Yes!’”
D. ‘”Once upon a time…”, she said.’
37. Which is not a valid variable name in Python?
A. _str
B. str
C. str255
D. 255str
38. Which of the following is not valid?
A. _x = 5
B. __x = 5
C. __var__ = 5
D. None of the above
39. Which of the following is an invalid statement?
A. abc = 1,000,000
B. a_b_c = 1,000,000
C. a b c = 1000 2000 3000
D. a,b,c = 1000, 2000, 3000
40. Which of the following cannot be a variable?
A. in
B. it
C. on
D. __init__
41. What is the average value of the following Python code snippet?
1. >>>grade1 = 80
2. >>>grade2 = 90
3. >>>average = (grade1 + grade2) / 2
A. 85.0
B. 85.1
C. 95.0
D. 95.1
Subscribe our youtube channel for live classes by click on the below link
https://www.youtube.com/@olevelguruji
42. Select all options that print.
hello-how-are-you
A. print(‘hello-‘ + ‘how-are-you’)
B. print(‘hello’, ‘how’, ‘are’, ‘you’)
C. print(‘hello’, ‘how’, ‘are’, ‘you’ + ‘-‘ * 4)
D. print(‘hello’ + ‘-‘ + ‘how’ + ‘-‘ + ‘are’ + ‘you’)
43. Select the correct example of complex datatype in Python
A. 5j
B. -100j
C. 3 + 2j
D. All of the above are correct
44. l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?
A. Set
B. Tuple
C. List
D. None of these
45. How can we create an empty list in python?
A. list=()
B. list=[]
C. list.null
D. null.list
46. If x=3.123, then int(x) will give ?
A. 0
B. 1
C. 3
D. 3.1
47. What is type casting in python?
A. Destroy data type
B. Change data type property
C. Declaration of data type
D. None of the above
48. Which of these about a dictionary is false?
A. Dictionaries aren’t ordered
B. The keys of a dictionary can be accessed using values
C. The values of a dictionary can be accessed using keys
D. Dictionaries are mutable
49. Which of the following is incorrect about dictionary keys?
A. Keys must be integers
B. Keys must be immutable
C. More than one key isn’t allowed
D. When duplicate keys encountered, the last assignment wins
50. If we change one data type to another, then it is called
A. Type conversion
B. Type casting
C. Both of the above
D. None of the above
I Hope you like o level python (m3 r5) mcq.Please share and Comment on our post
Also Check Latest uploads