Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
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)
53 views
Python MCQ
S9ysitsitsisgo
Uploaded by
siddheshverma0912
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python MCQ For Later
Download
Save
Save Python MCQ For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
53 views
Python MCQ
S9ysitsitsisgo
Uploaded by
siddheshverma0912
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python MCQ For Later
Carousel Previous
Carousel Next
Save
Save Python MCQ For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
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
Python Programming (MCQS)
PDF
No ratings yet
Python Programming (MCQS)
106 pages
Python MCQ - Curious Programmer
PDF
No ratings yet
Python MCQ - Curious Programmer
61 pages
Python and ML MCQ
PDF
No ratings yet
Python and ML MCQ
25 pages
MCQ On Python
PDF
No ratings yet
MCQ On Python
10 pages
Python MCQ
PDF
0% (2)
Python MCQ
123 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
Programming and Problem Solving
PDF
No ratings yet
Programming and Problem Solving
23 pages
Python Questions and Answers - Variable Names: Advertisement
PDF
No ratings yet
Python Questions and Answers - Variable Names: Advertisement
10 pages
Python Question With Answers
PDF
100% (4)
Python Question With Answers
7 pages
Python DCE3201 New
PDF
No ratings yet
Python DCE3201 New
29 pages
SodaPDF Converted Python
PDF
No ratings yet
SodaPDF Converted Python
35 pages
Python
PDF
No ratings yet
Python
126 pages
Python test1-QB-CA1
PDF
No ratings yet
Python test1-QB-CA1
14 pages
Python Questions and Answers
PDF
No ratings yet
Python Questions and Answers
61 pages
xi_computer science.doc-M
PDF
No ratings yet
xi_computer science.doc-M
19 pages
1 MCQ Class 11th Variables
PDF
No ratings yet
1 MCQ Class 11th Variables
4 pages
Python MCQ
PDF
50% (4)
Python MCQ
13 pages
12
PDF
No ratings yet
12
23 pages
Pythonmcq
PDF
No ratings yet
Pythonmcq
16 pages
Python MCQ
PDF
0% (1)
Python MCQ
34 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
Assignment-Questions-Python 2 Feb24
PDF
No ratings yet
Assignment-Questions-Python 2 Feb24
13 pages
MCQS_IP_11
PDF
No ratings yet
MCQS_IP_11
8 pages
UNIT-1 Introduction To Python Programming
PDF
No ratings yet
UNIT-1 Introduction To Python Programming
10 pages
14.-RSM-Question-Bank_PWP_22616_RSD-compressed
PDF
No ratings yet
14.-RSM-Question-Bank_PWP_22616_RSD-compressed
40 pages
Current Spot 7
PDF
No ratings yet
Current Spot 7
4 pages
2.Python Unit 2 Question Bank
PDF
No ratings yet
2.Python Unit 2 Question Bank
25 pages
XII Computer Science MCQ Chapter Wise Internet
PDF
No ratings yet
XII Computer Science MCQ Chapter Wise Internet
266 pages
XI(CS) Question Bank (1)
PDF
No ratings yet
XI(CS) Question Bank (1)
35 pages
Final Python Question Bank
PDF
No ratings yet
Final Python Question Bank
457 pages
Class 11 Python Mcq
PDF
No ratings yet
Class 11 Python Mcq
24 pages
Python 2
PDF
No ratings yet
Python 2
26 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
WORKSHEET 1 (Chapter 1,2 & 3)
PDF
No ratings yet
WORKSHEET 1 (Chapter 1,2 & 3)
55 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
BCA2A Python
PDF
No ratings yet
BCA2A Python
8 pages
Python MCQ With Answer TEST-1
PDF
No ratings yet
Python MCQ With Answer TEST-1
18 pages
Hahahaha Python Questions - Variable Names
PDF
No ratings yet
Hahahaha Python Questions - Variable Names
11 pages
Computer Science - Cs083 Full Test-1
PDF
No ratings yet
Computer Science - Cs083 Full Test-1
31 pages
MCQ-1
PDF
No ratings yet
MCQ-1
28 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
CSC201+++ By BIGTUBA (1)
PDF
No ratings yet
CSC201+++ By BIGTUBA (1)
64 pages
406C - Python Programming
PDF
No ratings yet
406C - Python Programming
20 pages
E-Notes_881_Content_Document_20250212032705PM
PDF
No ratings yet
E-Notes_881_Content_Document_20250212032705PM
25 pages
M3 R5 Python MCQ
PDF
No ratings yet
M3 R5 Python MCQ
7 pages
Computer Science questions and answers
PDF
No ratings yet
Computer Science questions and answers
57 pages
Python mc1111
PDF
No ratings yet
Python mc1111
18 pages
Python MCQ 3
PDF
No ratings yet
Python MCQ 3
148 pages
PWT Sample Paper
PDF
No ratings yet
PWT Sample Paper
2 pages
Csc201 MCQ Questions (Updated) Compiled by Engr Marvie ... More To Come.
PDF
No ratings yet
Csc201 MCQ Questions (Updated) Compiled by Engr Marvie ... More To Come.
8 pages
1 Mark Questionsf
PDF
No ratings yet
1 Mark Questionsf
9 pages
12 CS Board Set 4 QP
PDF
No ratings yet
12 CS Board Set 4 QP
5 pages
Sol_CS_Pre_Brd_2_2024-25_5thSub.rtf
PDF
No ratings yet
Sol_CS_Pre_Brd_2_2024-25_5thSub.rtf
15 pages
Class Xi - Chapterwise - MCQ
PDF
No ratings yet
Class Xi - Chapterwise - MCQ
45 pages
Class XI (Computer Science) Chapterwise MCQ
PDF
No ratings yet
Class XI (Computer Science) Chapterwise MCQ
66 pages
Computer Science Question Class 11 PDF
PDF
No ratings yet
Computer Science Question Class 11 PDF
8 pages
MCQS of Cyber Ethics ...
PDF
No ratings yet
MCQS of Cyber Ethics ...
21 pages
Certificate 1
PDF
No ratings yet
Certificate 1
1 page
Cyber Ethics Notes
PDF
100% (4)
Cyber Ethics Notes
15 pages
Assertion and Reason
PDF
No ratings yet
Assertion and Reason
5 pages