Python Multiple Choice Questions(MCQs)& Answers | Python Objective Questions

Sports GK Questions and Answers 2024 (Latest Updated)

Awards & Honours GK Questions 2024 (Latest Updated)

Questions
1 What is answer of this expression, 22 % 3 is?
A 7
B 1
C 0
D 5

Answer: 1
2 What is the output of this expression, 3*1**3?
A 27
B 9
C 3
D 1

Answer: 3
Advertisement
Article and Schedule Quiz Start Test!
DOWNLOAD CURRENT AFFAIRS PDF FROM APP
3 Which of the following will run without errors ?
A round(45.8)
B round(6352.898,2,5)
C round()
D round(7463.123,2,1)

Answer:round(45.8)
4 What dataype is the object below ?

L = [1, 23, ‘hello’, 1].

A list
B dictionary
C array
D tuple

Answer: list
5 What does --------- 5 evaluate to?
A +5
B -11
C +11
D -5

Answer: +5
6 What is the result of round(0.5) – round(-0.5)?
A 1.0
B 2.0
C 0.0
D None of the mentioned

Answer: 2.0
7 What is the maximum possible length of an identifier?
A 31 characters
B 63 characters
C 79 characters
D none of the mentioned

Answer: none of the mentioned
8 All keywords in Python are in
A lower case
B UPPER CASE
C Capitalized
D None of the mentioned

Answer: None of the mentioned
9 Which of the following is an invalid statement?
A abc = 1,000,000
B a b c = 1000 2000 3000
C a,b,c = 1000, 2000, 3000
D a_b_c = 1,000,000

Answer: a b c = 1000 2000 3000
10 Which of these in not a core datatype?
A Lists
B Lists
C Tuples
D Class

Answer:Class
11 Is Python case sensitive when dealing with identifiers?
A yes
B no
C machine dependent
D none of the mentioned

Answer: yes
12 What is the maximum possible length of an identifier?
A 31 characters
B 63 characters
C 79 characters
D none of the mentioned

Answer: none of the mentioned
13 Which of the following is invalid?
A _a = 1
B __a = 1
C __str__ = 1
D none of the mentioned

Answer: none of the mentioned
14 Which of the following is an invalid variable?
A my_string_1
B 1st_string
C foo
D _

Answer: 1st_string
15 Why are local variable names beginning with an underscore discouraged?
A they are used to indicate a private variables of a class
B they confuse the interpreter
C they are used to indicate global variables
D they slow down execution

Answer: they are used to indicate a private variables of a class
16 Which of the following is not a keyword?
A eval
B assert
C nonlocal
D pass

Answer: eval
17 All keywords in Python are in _________
A lower case
B UPPER CASE
C Capitalized
D None of the mentioned

Answer:None of the mentioned
18 Which of the following is true for variable names in Python?
A unlimited length
B all private members must have leading and trailing underscores
C underscore and ampersand are the only two special characters allowed
D none of the mentioned

Answer: unlimited length
19 Which of the following is an invalid statement?
A abc = 1,000,000
B a b c = 1000 2000 3000
C a,b,c = 1000, 2000, 3000
D a_b_c = 1,000,000

Answer: a b c = 1000 2000 3000
20 Which of the following cannot be a variable?
A __init__
B in
C it
D on

Answer: in
Assam Direct Recruitment Test Series

Teacher Eligibility Test

Assam Direct Recruitment Test Series