Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
68 views
6 pages
Python MCQ
S9ysitsitsisgo
Uploaded by
siddheshverma0912
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Python MCQ For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
68 views
6 pages
Python MCQ
S9ysitsitsisgo
Uploaded by
siddheshverma0912
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Python MCQ For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Python MCQ For Later
You are on page 1
/ 6
Search
Fullscreen
Python MCQ (Multi Choice Questions) Q What is the maximum possible length of an identifier? a. 16 b, 32 c. 64 d. None of these above Answer: (d) None of these above Explanation: The maximum possible length of an identifier is not defined in the python language. It can be of any number, Q. Who developed the Python language? a. ZimDen b. Guido van Rossum ©. Niene Stom d. Wick van Rossum Answer: (b) Guido van Rossum Explanation: Python language was developed by Guido van Rossum in the Netherlands. Q In which year was the Python language developed? a 1995 b. 1972 c. 1981 d. 1989 Answer: (d) 1989 Explanation: Python language was developed by Guido van Rossum in 1989. Q In which language is Python written? a. English b. PHP « C d. All of the above Answer: (b) C Explanation: Python is written in C programming language, and it is also called CPython. Q. Which one of the following is the correct extension of the Python file? PY b. python cP d. None of these the correct extension of the Python file. Q In which year was the Python 3.0 version developed? a 2008 b. 2000 c. 2010 d. 2005 Answer: (a) 2008 Explanation: Python 3.0 version was developed on December 3, 2008.yeepe Q. What do we use to define a block of code in Python language? a Key b. Brackets ¢. Indentation 4d. None of these Answer: (c) Indentation Explanation; Python uses indentation to define blocks of code. Indentations are simply spaces or tals used as an indicator that is part of the indent code child. As used in curly braces C, C++, and Java. Q Which character is used in Python to make a single line comment? a bo c # a! Answer: (c) # Explanation: Q Which of the following statements is correct regarding the object-oriented programming concept in Python’? a, Classes are real-world entities while objects are not real b. Objects are real-world entities while classes are not real c, Both objects and classes are real-world entities d. Allof the above “#" character is used in Python to make a single-line comment. Answer: (b) Objects are real-world entities while classes are not real Explanation: None Q. Which of the following statements is correct in this python code? ‘class Name: javajavaipoint = java 8. It will throw the error as multiple references to the same object is not possible b. id(name!) and id(name2) will have same value ¢. Both name! and name? will have reference to two different objects of class Name 4d. Allof the above Answer: (b) id(name! ) and id(name2) will have same value ‘name1" and "name2" refer ta the same object, so id(name!) and id(name2) will have ‘the same value, Q What is the method inside the class in python language? a Object, b. Function cc, Attribute: d. Argument Answer: (b) Function Explanation: Function is also known as the method.Q. Which of the following operators is the correct option for powertab)? a at b. ab ce. ahhh di at*b Answer: (b) a*b Explanation: The power operator in python is a**b, ic, 2**3=8, Q. Which of the following precedence order is correct in Python? 4. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction, b. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential ¢, Division, Multiplication, Addition, Subtraction, Parentheses, Exponential 4, Exponential, Parentheses, Multiplication, Division, Addition, Subtraction Answer: (a) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction Explanation: PEMDAS (similar to BODMAS). Q. Which one of the following has the same precedence level? a Division, Power, Multiplication, Addition and Subtraction b. Division and Multiplication ¢, Subtraction and Division d. Power and Division Answer: (b) Division and Multiplication ‘Explanation: None Q. Which one of the following has the highest precedence in the expression? a Division b. Subtraction cc. Power Parentheses Answer: (d) Parentheses Explanation: PEMDAS (similar to BODMAS). . Which of the following functions is a built-in function in python language’? a. ‘val() b. print ce. print() d. None of these Answer: (b) print() Explanation: The print() function is a built-in function in python language that prints a value directly to the system. Q. Study the following funetion: round(4.576) What will be the output of this function? a 4 bos c. 576 ds Answer: (d) 5: The round function is a built-in function in the Python language that round-off the value (like 3.85 is 4), so the output of this function will be 5. Q Which of the following is correctly evaluated for this function? pow(x.y.z) a (xy) /z b. (&/y)#z eC) % dd @&/y/2 Answer: (c) (x**y) % 2 ‘Explanation; None Q. Study the following function: all((2,4,0,6)) ‘What will be the output of this function? a False b. Tre 0 d. Invalid code Answer: (a) False ‘Explanation: If any element is zero, it returns a false value, and if all elements are non-zero, it returns true value, Hence, the output of this “all({2,4,0,6])" function will be false. Q. Study the following program: x=1 while True: ifx%5 break rint(x) x+el ‘What will be the output of this code? a error b 21 e031 d. None of these Answer: (a) error Explanation: Syntax error, there should not be a space between + and =, Q. Which one of the following syntaxes is the correct syntax to read from a simple text file stored in javatxt’ Infile Infile Infile Infile Answer: (a) Infile = open(’c:\scores.tx ‘Explanation: NonewRYNe DURWIS BADD EUNE Q. Study the following program: isk while True: if i963 break print(i) Which of the following is the correct output of this program? a 123 b. 321 c. 12 Invalid syntax Answer: (d) Invalid syntax Explanation: Invalid syntax, because this declaration ( ) is wrong. Q. Study the following program: a=1 while True: ifa% 7= break print(a) ats Which of the following is correct output of this program? a. 12345 b. 123456 ec. 1234567 d. Invalid syntax Answer: (b) 123.456 Explanation: None Q. Study the following program: i=0 while i < 5: print(i) its! ifi break else: print(0) What will be the output of this statement? a 123 b. 0123 . O12 d 321 Answers (¢)0 12 Explanation: NoneStudy the following program: = (0,1,2) for ind: prima) ‘What will be the output ofthis statement? a 40.1.2) (0,1,2} (0, 1,2) b 012 ©. Syntx_Eor d._ None ofthese shove Answer: (b) 0112 Explanation: None Q, Which ofthe following option is not a core datatype in the python language? a Dictionary b. Lists ce. Class Alot the above Answer: (c) Class Explanation: Classis not a core datatype because it user-defined data type Q. What error will occur when you execute the following code? MANGO = APPLE a. NameErvor 1b. SyntaxExror ce. TypeEror 4d. ValueError Answer: (a) NamaEror Explanation: Mango is not defined hence the name ero . Study the following program: def example(a) aa=as'T aa=atl >>>examplo("javatpoint”) ‘What will be the output ofthis statement? a. hello2hello2 b. hello? ‘e. Cannot perform mathematical operation on strings
You might also like
Class 11 Python MCQ
PDF
No ratings yet
Class 11 Python MCQ
24 pages
Cyber Ethics Notes
PDF
100% (4)
Cyber Ethics Notes
15 pages
Python and ML MCQ
PDF
No ratings yet
Python and ML MCQ
25 pages
XII Computer Science MCQ Chapter Wise Internet
PDF
No ratings yet
XII Computer Science MCQ Chapter Wise Internet
266 pages
Python Question With Answers
PDF
100% (4)
Python Question With Answers
7 pages
Final Python Question Bank
PDF
No ratings yet
Final Python Question Bank
457 pages
CLASS XII Computer Science MCQS Chapter 1 Python Revision Tour - Removed
PDF
No ratings yet
CLASS XII Computer Science MCQS Chapter 1 Python Revision Tour - Removed
8 pages
Python MCQ With Answer TEST-1
PDF
No ratings yet
Python MCQ With Answer TEST-1
18 pages
Python test1-QB-CA1
PDF
No ratings yet
Python test1-QB-CA1
14 pages
Pythonmcq
PDF
No ratings yet
Pythonmcq
16 pages
Python MCQ
PDF
0% (1)
Python MCQ
34 pages
CSC201+++ by BIGTUBA
PDF
No ratings yet
CSC201+++ by BIGTUBA
64 pages
Python MCQ
PDF
50% (4)
Python MCQ
13 pages
Computer Science Questions and Answers
PDF
No ratings yet
Computer Science Questions and Answers
57 pages
Python Programming (MCQS)
PDF
No ratings yet
Python Programming (MCQS)
106 pages
Computer SC HHW
PDF
No ratings yet
Computer SC HHW
45 pages
Python MCQ
PDF
0% (2)
Python MCQ
123 pages
Sure Shot Questions 2024-25 Final
PDF
No ratings yet
Sure Shot Questions 2024-25 Final
55 pages
XI (CS) Question Bank
PDF
No ratings yet
XI (CS) Question Bank
35 pages
RSM Question Bank - PWP - 22616 - RSD Compressed
PDF
No ratings yet
RSM Question Bank - PWP - 22616 - RSD Compressed
40 pages
Q1 Single Line Comments in Python Begin With Symbol.: Most Important Multiple Choice Questions
PDF
No ratings yet
Q1 Single Line Comments in Python Begin With Symbol.: Most Important Multiple Choice Questions
17 pages
Python Questions and Answers
PDF
No ratings yet
Python Questions and Answers
61 pages
CSC 201 MCQ's + Answers On CSC201 by PELUMI (FAKI)
PDF
No ratings yet
CSC 201 MCQ's + Answers On CSC201 by PELUMI (FAKI)
31 pages
MCQ 1
PDF
No ratings yet
MCQ 1
28 pages
Python
PDF
No ratings yet
Python
126 pages
SodaPDF Converted Python
PDF
No ratings yet
SodaPDF Converted Python
35 pages
Python DCE3201 New
PDF
No ratings yet
Python DCE3201 New
29 pages
E-Notes 881 Content Document 20250212032705PM
PDF
No ratings yet
E-Notes 881 Content Document 20250212032705PM
25 pages
Python MCQ Set of All Units
PDF
No ratings yet
Python MCQ Set of All Units
23 pages
Python 2
PDF
No ratings yet
Python 2
26 pages
2.python Unit 2 Question Bank
PDF
No ratings yet
2.python Unit 2 Question Bank
25 pages
What Will Be The Output of The Following Code?: A) 6 B) 8 C) 9 D) 11 B) 8
PDF
No ratings yet
What Will Be The Output of The Following Code?: A) 6 B) 8 C) 9 D) 11 B) 8
23 pages
M3 R5 Python MCQ
PDF
No ratings yet
M3 R5 Python MCQ
7 pages
Programming and Problem Solving
PDF
No ratings yet
Programming and Problem Solving
23 pages
Xi - Computer Science - Doc-M
PDF
No ratings yet
Xi - Computer Science - Doc-M
19 pages
Practice Questions Introduction To Python
PDF
No ratings yet
Practice Questions Introduction To Python
21 pages
Shri. S. H. Kelkar College of Arts, Commerce and Science, Devgad
PDF
No ratings yet
Shri. S. H. Kelkar College of Arts, Commerce and Science, Devgad
4 pages
WORKSHEET 1 (Chapter 1,2 & 3)
PDF
No ratings yet
WORKSHEET 1 (Chapter 1,2 & 3)
55 pages
Q4 - Computer 6
PDF
No ratings yet
Q4 - Computer 6
11 pages
Computer Science - Cs083 Full Test-1
PDF
No ratings yet
Computer Science - Cs083 Full Test-1
31 pages
Python mc1111
PDF
No ratings yet
Python mc1111
18 pages
Python Questions and Answers - Variable Names: Advertisement
PDF
No ratings yet
Python Questions and Answers - Variable Names: Advertisement
10 pages
Python MCQ - Curious Programmer
PDF
No ratings yet
Python MCQ - Curious Programmer
61 pages
MCQ On Python
PDF
No ratings yet
MCQ On Python
10 pages
406C - Python Programming
PDF
No ratings yet
406C - Python Programming
20 pages
MCQS of Cyber Ethics ...
PDF
No ratings yet
MCQS of Cyber Ethics ...
21 pages
MCQS Ip 11
PDF
No ratings yet
MCQS Ip 11
8 pages
Assignment-Questions-Python 2 Feb24
PDF
No ratings yet
Assignment-Questions-Python 2 Feb24
13 pages
PP Objective Question Bank
PDF
No ratings yet
PP Objective Question Bank
5 pages
12
PDF
No ratings yet
12
23 pages
1 MCQ Class 11th Variables
PDF
No ratings yet
1 MCQ Class 11th Variables
4 pages
Python Basics
PDF
No ratings yet
Python Basics
2 pages
Onlinebits PDF
PDF
No ratings yet
Onlinebits PDF
20 pages
ComputerScience SQP Set3 MS
PDF
No ratings yet
ComputerScience SQP Set3 MS
12 pages
Question Bank Python Programming: 1) What Is The Maximum Possible Length of An Identifier?
PDF
No ratings yet
Question Bank Python Programming: 1) What Is The Maximum Possible Length of An Identifier?
15 pages
Hahahaha Python Questions - Variable Names
PDF
No ratings yet
Hahahaha Python Questions - Variable Names
11 pages
Assertion and Reason
PDF
No ratings yet
Assertion and Reason
5 pages
Current Spot 7
PDF
No ratings yet
Current Spot 7
4 pages
UNIT-1 Introduction To Python Programming
PDF
No ratings yet
UNIT-1 Introduction To Python Programming
10 pages
BCA2A Python
PDF
No ratings yet
BCA2A Python
8 pages
Certificate 1
PDF
No ratings yet
Certificate 1
1 page