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)
75 views
18 pages
MCQ On Python 5eea6a1139140f30f369ebae
Uploaded by
Sharlin Regina
AI-enhanced title
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 Mcq on Python 5eea6a1139140f30f369ebae For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
75 views
18 pages
MCQ On Python 5eea6a1139140f30f369ebae
Uploaded by
Sharlin Regina
AI-enhanced title
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 Mcq on Python 5eea6a1139140f30f369ebae For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 18
Search
Fullscreen
De Brac) Python Questions Latest Python MCQ Objective Questions CER ABR he lial RI a eon Start Complete Exam Preparation jon Bank Dally Live rey boca Cie a Download App Question 1: View this Question Online > What are Python files containing Python definitions and statementscalled? 1. Flowcharts 2. Algorithms 3. Modules 4, Sequences Answer (Detailed Solution Below) ’ : Modulescoaching India's Super Teachers for all ef Ay AO Tel Oln moles or Python Question 1 Detailed Solution Python files containing Python definitions and statements are called modules. So the answer is (3). i Key Points — + A module isa file that contair Pa ‘ode, suchas functions, classesand variables. Modules canbe imported into othe Pykon files, which allows you to reuse code and organize your code into smaller, more 1 files. + Modules are typically named with a .py extension. For example, a module named my_module.py would contain Python code that can be imported into other Python files using the following statement: 2 import my_module * Once you have imported a module, you can accessthe code in that module using the module's name. For example, if you have a function called greet() in the my_module.py module, you can call that function fram another Python file using the following statement my_module.greet() + Modules are a powerful feature of Python that allow you to write more organized and reusable code. & Additional Information + Flowchartsare visual representations of algorithms. + Algorithms are step-by-step instructions for solving a problem. + Sequencesare ordered lists of elements. wr eae Rare) Rey Scam Ce Cima elo) Pus oes Pac as Cold Question Bank Exit ey id D> Download AppQuestion 2: \* View this Question Online > co find the output of the program ot = Oo eee ye pl atl 1.123456 ny . 12345678 . 123456789 4. none of these a . None of the above/More than one of the above Answer (Detailed Solution Below) 0° Option 2:12345678 nN Python Question 2 Detailed XS Correct answeris option B + program start from 1 + checkcondition ifa% 9== * then run and print all the value of a till a=8 + when a=9 then condition is false + then program Break + Sothe answeris1 2345678ee ee a Meet Boel OR DR Re eras Start Complete Exam Preparation ca Pear feed ies ca Vessel Cres eau peer Download App Question 3: View this Question Online > What is the output of following code: print (type(type(int))) 1. type ‘int 3. error 5. None of the above/More than one of the above Answer (Detailed Solution Below) Option 2: Python Question 3 Detailed Solution Concept: Type function type() : It either returns the type of the object or returns anew type object based on the argument passedto it. Explanation: If we passsingle object to type(), then it returns its type. Here code is given as:Print type(typeqing)) It returns the classof the argument to which object belongs. So, it return type Pees a errr) Sey Start Complete Exam Preparation Penne eae area Gite Pecoraro Question 4: View this Question Online > What is output of the code in Python Language: >>> str1= All the Best’ >> striL3] 4.7% 5. None of the above/More than one of the above Answer (Detailed Solution Below) Option 2:'e Python Question 4 Detailed Solution © Key Points.Here str is an array of continuous elements, str1[0]=A=str1L0] stri[i}=l=str1 11] str1[2]=l=str1[-10] str1[3]=" ‘=str1£9] str1[4]=t=str 8) str1[5]=h=str1L7] str1[6]=e=str1[-6] stri[7I=' '=str1L-5] str1[8]=B=st1[-4] a str1[9]=e=str1[-3] 0 -3 -2 -1 Aj ljl t{hje Ble|s}t Ow 2s es 67 8 9 10.71 str1 Hence the correct answer is ©: India's #1 Learning Platform Cees Start Complete Exam Preparation Bk: Gece ean Corres a Ga cree Question 5: View this Question Online > What will be the output of the following command in python? a= "python" whilei in a:a= afl] print(i, end = "P)| =" » A 2. python 3. pppppp 4, More than one of the above 5. None of the above Answer (Detailed Solution Below) Option 3:pppppp Python Question 5 Detailed Solution ’ In python language, +1 Iscalled list indexing or 1 3 It returns the whole messageasit Is but without the last element. You can alwayschange the number to -2 of -3 according to the requirement. Hence the answer willbe ppp ppp. In every loop one letter will be eliminated from the string and p will be printed with" * string in the end. Note:- For better understanding try to run the above program. Top Python MCQ Objective Questionsshane acta Trusted by 1,86,00,449+ Student: Start Complete Exam Preparation eae pan Pala te Csr Gd Download App Question 6: View this Question, @nline™> “eg is NOT’ feature of Python language? -Ipterpreted language 2. Portable High level language 4, Caseinsensitive Answer (Detailed Solution Below) Option 4: Caselnsensitive Python Question 6 Detailed Solution © Key Points. Python is a dynamic, high-level, free open source, and interpreted programming language. It supports object-oriented programming aswell as procedurel- oriented programming. Feature of Python language + Easyto code + Free and Open Source a + Object-Oriented Languaae + GUI Programming Support. + High-Level Language Extensible feature Python isa Portablelanguage + Python isan integrated language + Interpreted Language Large Standard Library Dynamically Typed Language It case-sensitive programming language.Hence the correct answer is Caseinsensitive ee ae Rec tiy Pela (CM Cm e le Laced) CR Soc eo au ales Cel (ee Download App Question 7: View this Question Online > What does this program print? days= "Mon, Tue, Wed, Thu, Fri, Sat, Sun" print(daysf::5]) 1. Mon Tue Wea ThUFTi Sat Sun »N 3. MTWTFSS. 47 Answer (Detailed Solution Below) Option 3: MTWTFSS. Python Question 7 Detalled Solution Concept: Slicing: It is used to slicea particular sequence. We can specifywhereiit’startsand where it will end, how many characterscan be skipped. Explanation:FS ee days = “Mon, Tue, Wed, 7 print(daysf::5]) Output: In this, slice startsat the first character and includes every fifth character whichis : MIWTFSS Italso count spaceasa character. Important Point: “Mon, Tue” in this 4*” characteris space eee sen etl Reena rote Start Complete Exam Preparation emer ee ities Doeciapry jownload App Question 8: View this Question Online > The command used to start Python from the command prompt is. . execute python 3. py 4. Both 2 and 3 are correct Answer (Detailed Solution Below) Option 4: Both 2 and 3 are correct Python Question 8 Detailed Solution To execute python from the command prompt, ‘python’ andpy) commandsis entered.The Correct Answer is Both py and python a : ees Re Reto Start Complete Exam Preparation iPS cero B Download App Question 9: What isthe output of the below program in python: print(0.2+ 0.4== 0.6) 1 —™ 2. False 3. Error 4, Depends on machine Answer (Detailed Solut' Option 2: False CR RR eresa ee eo ae ee NC TT Ie eT REET 0.2, 0.4 and 0.6 can not be represented accurately in binery. The round off errors from m 0.4 addsup Hence there is a difference between (0.2 + 0.4)and 0.6. Thisis becauseyou can not compare floating point value, asit cannot be considered precise. Note: Ifyou run above program then we will get the output false. India’s #1 Learning Platform Start Complete Exam Preparation Cal] a (z) red { Daa es Col a Ge Sa Exeter) Download App Question 10: View this Question Online > What will be output of the following command in python? print (r"\nhello’) 1 > \ 2. new line and hello 3. \nhello 4. Error Answer (Detailed Solution Below) Option 3: \nhello Python Question 10 Detailed Solution RoC coteIn python language, ~ when'r’ or 'R’ is used before the string, it converts the string into a raw string and the escape sequence like \n are not converted. Hence the answeris \nhello. GEER ABR Ret liial Start Complete Exam Preparation BCC DAR Seco Poscoeery Gree nee be Question Bank Exotica) Download App Question 11: View this Question Online > What will be the result of the below command in python language: round(0.4) - round(-0.5) Answer (Detailed Solution Below) Option 1:0 Python Question 11 Detailed Solution In python language, the svstemrounds off the number away from 0 when the number which has to be rounded offis.halfway through. This means, round(0.4) = 0 and round(-0 This gives, 0-(-0) = 0 x NOTE: It does not depend on the negative value.The round function is used to round the value.r Eg: round(0 to 0.5)gives as 0. round(-0.6 to -0.9) gives 2-1. Hence the answer is 0. eRe anon ete Renae Pott Start Complete Exam Pr lees Phd aca laa ‘Question Bank Exotic) Jownload App Question 12: View this Question Online > What is the output of the code in Python Language: for num in range (3): ifnum > 0 print (num*100) 1 7~ 2. 100, 100, 100 3. 100,200 4. 300,200 Answer (Detailed Solution Below) Option 3: 100, 200Python Question 12 Detailed Solution © Key Points Python range() Basics : In simple terms, range() allows the user to generate a series of numbers within a given range. for num in range (3): ifnum > 0: ~a print (num*100) Here num has initially 0 and it prints num = 100 gives 0 as output and next iteration num is 1 and prints 100. After num has2 and prints 200. And finally range become closes. Hence the correct answer is 100,200. Note: for better understandingrun the above program. ee eae) SP POPOL Ea Pea mC Me Cima erLe Laced) alee eas Des ciolen resieicoug Download App Question 13: View this Question Online > Which of following is keyword used in python? 4. finally 2, lambda 3 Pm 4, Allof above Answer (Detailed Solution Below) Option 4: All of abovePython Question 13 Detailed Solution The correct answeris option 4. Concept: In Python, reserved words are referred to as keywords. A Keyword cannot be used asa variable name, function name, or other identifiers. Here's a list of all keywords in Python Programming: False, await, else, import, ik break, except, in, raise, True, class finally, is, return, and, continue, for, lambda, try. as, ‘om, nonlocal, while, assert.del, global, not, with, asyne elf, if, or, yield. The keywords listed above may change between Python versions. Some extras may be added, while others may be deleted. You may alwaysretrieve alist of keywords in your current version by entering the following command at the prompt. Syntax: >>> import keyword >>> print(keyword.kwlist) Hence the correct answer is All of above. India's #1 Learning Platform Cacia cotta Start Complete Exam Preparation ieee kes iw foster Ext z ra) Download App resieacg Question 14: View this Question Online > What isthe maximum length of a Python identifier? 1. 33 2. 28 4. No fixed length specifiedAnswer (Detailed Solution Below) Option 4: No fixed length specified Python Question 14 Detailed Solution The correct answeris option 4. Concept: Python Identifiers are namesassignedto things suchas classesfunctions, variables, and soon. It helps in distinguishing one entity from another. Rules for writing identifiers: + An identifier canbe of any length, + Identifiers can be a mix of lowercase(@-z)or capital (A-Z) characters,numerals (0-9), or underscore(_). Namesiiféiifmy Class, var_1 and print_this_to_screen, all are valid exemple. + A digit cannot be the firstehayacter of an identifier. Variable is an acceptablename, but variable is not. + Keywords cannot be used asidentifiers. + In our identifier, we cannot use special characterssuch as |, @, #, $, percent, and so on. Explanation: In python an Identifier there is no fixed length so the identifier canbe of any lenath. Hence the correct answer is No fixed/ength specified. og x rN India’s #1 Learning Platform Ree ar kot ASE Ta meni) (CM Clune) ia ) Dally Live eed Pea Reston resieuccg Exeter Download App Question 15: View this Question Online > What will be the output of the following command in python? a= "python" isp while i in a:2. python 3. PPPPpp 4. None of the above Answer (Detailed Solution Below) co ¢ Option 3: pp pppp a ae Python Question 15 Detailed Solution XO In python language, eo +1 iscalled list indexing or ef the whole messageasit is but without the last element. You can alwayschange the number to -2 of -3 according to the requirement. Hence the answer willbe p PP PP P- In every loop one letter will be eliminated from the string and p will be printed with" " string in the end Note:- For better understanding try to run the above program.
You might also like
250 Python Quizzes
PDF
No ratings yet
250 Python Quizzes
100 pages
The Joy of Computing Using Python: Assignment 2
PDF
No ratings yet
The Joy of Computing Using Python: Assignment 2
5 pages
String MCQ
PDF
100% (1)
String MCQ
2 pages
I Pu Cs Chapter 5 Q&A-1
PDF
No ratings yet
I Pu Cs Chapter 5 Q&A-1
45 pages
Programming
PDF
No ratings yet
Programming
70 pages
XII Computer Science MCQ
PDF
No ratings yet
XII Computer Science MCQ
352 pages
Important QnA Modelling AI Class 10
PDF
No ratings yet
Important QnA Modelling AI Class 10
3 pages
Paper2 Programming
PDF
No ratings yet
Paper2 Programming
124 pages
Class Xi Flow of Control Ws
PDF
100% (1)
Class Xi Flow of Control Ws
2 pages
Programming C++: Chapter 5: Arrays and Strings
PDF
No ratings yet
Programming C++: Chapter 5: Arrays and Strings
81 pages
AD3501 Deep Learning Course Plan
PDF
No ratings yet
AD3501 Deep Learning Course Plan
6 pages
What Will Be The Output of The Following Code Snippet?: Print (2 3 + (5 + 6) (1 + 1) )
PDF
No ratings yet
What Will Be The Output of The Following Code Snippet?: Print (2 3 + (5 + 6) (1 + 1) )
70 pages
Lab 8 C++ Loops
PDF
100% (1)
Lab 8 C++ Loops
44 pages
Chapter - 7 Strings in Python
PDF
100% (1)
Chapter - 7 Strings in Python
21 pages
Std. 8th MCQ
PDF
No ratings yet
Std. 8th MCQ
9 pages
AP PGECET CS and IT (CS-2015) Question Paper & Answer Key. Download All Previous Years Computer Science & Information Technology Sample & Model Question Papers.
PDF
100% (2)
AP PGECET CS and IT (CS-2015) Question Paper & Answer Key. Download All Previous Years Computer Science & Information Technology Sample & Model Question Papers.
16 pages
Chap 03 - Algorithm Design For Sequence Control Structure
PDF
No ratings yet
Chap 03 - Algorithm Design For Sequence Control Structure
35 pages
Python Programming Set 1
PDF
100% (1)
Python Programming Set 1
8 pages
MCQ On Logic Gates and Boolean Algebra 5eea6a0d39140f30f369e1ed
PDF
No ratings yet
MCQ On Logic Gates and Boolean Algebra 5eea6a0d39140f30f369e1ed
28 pages
Aismv - Xii - Solved - QB - Review of Xi
PDF
No ratings yet
Aismv - Xii - Solved - QB - Review of Xi
10 pages
Python Questions and Answers - Files - 1: Advertisement
PDF
No ratings yet
Python Questions and Answers - Files - 1: Advertisement
12 pages
Second Pre Board Set2
PDF
No ratings yet
Second Pre Board Set2
7 pages
Question Bank Unit 1 PDF
PDF
No ratings yet
Question Bank Unit 1 PDF
27 pages
Ernakulam Region QP With MS
PDF
No ratings yet
Ernakulam Region QP With MS
21 pages
Final Term Question Paper Class XI Computer Science
PDF
No ratings yet
Final Term Question Paper Class XI Computer Science
4 pages
CS Sample Paper 8
PDF
No ratings yet
CS Sample Paper 8
8 pages
XIComp SC H Y 414
PDF
100% (1)
XIComp SC H Y 414
6 pages
Sample Question Paper - 2 (2022-23) : Set No Roll No
PDF
No ratings yet
Sample Question Paper - 2 (2022-23) : Set No Roll No
13 pages
Problem Solving
PDF
No ratings yet
Problem Solving
90 pages
Feedback - Quiz 2a: You Submitted This Quiz On Sun 31 Jan 2016 7:44 PM PET. You Got A Score of 100.00 Out of 100.00
PDF
33% (3)
Feedback - Quiz 2a: You Submitted This Quiz On Sun 31 Jan 2016 7:44 PM PET. You Got A Score of 100.00 Out of 100.00
10 pages
Functions - Together With - MCQ and Answer Key
PDF
No ratings yet
Functions - Together With - MCQ and Answer Key
25 pages
10 Chapter 10 (202-241)
PDF
No ratings yet
10 Chapter 10 (202-241)
40 pages
Pro TCS Technical Paid Paper
PDF
100% (1)
Pro TCS Technical Paid Paper
66 pages
Tuples
PDF
No ratings yet
Tuples
37 pages
Errors in C Programming
PDF
No ratings yet
Errors in C Programming
19 pages
QP 11 CS
PDF
No ratings yet
QP 11 CS
6 pages
Class 10 IT Pre-Board Paper 23-24
PDF
No ratings yet
Class 10 IT Pre-Board Paper 23-24
5 pages
Data File Handling in Python Class 12 - Mcqs
PDF
No ratings yet
Data File Handling in Python Class 12 - Mcqs
5 pages
Class VIII Computer Test
PDF
No ratings yet
Class VIII Computer Test
4 pages
CS Set 1 QP
PDF
No ratings yet
CS Set 1 QP
11 pages
MCQ Function
PDF
No ratings yet
MCQ Function
13 pages
Data File Handling - Together With - MCQ and Answer Key
PDF
No ratings yet
Data File Handling - Together With - MCQ and Answer Key
26 pages
MCQ Data Science
PDF
No ratings yet
MCQ Data Science
1 page
Answer Key of KVS PGT Computer Science Exam Dated 14 December 2013 - RAS MAIN EXAM
PDF
100% (2)
Answer Key of KVS PGT Computer Science Exam Dated 14 December 2013 - RAS MAIN EXAM
6 pages
402 Information Tech SQP
PDF
No ratings yet
402 Information Tech SQP
6 pages
MCQ On Python 5eea6a1139140f30f369ebae
PDF
No ratings yet
MCQ On Python 5eea6a1139140f30f369ebae
18 pages
XII-Preboard II - Computer Science-Jan 2023
PDF
No ratings yet
XII-Preboard II - Computer Science-Jan 2023
10 pages
Class XI (Computer Science) Chapterwise MCQ
PDF
No ratings yet
Class XI (Computer Science) Chapterwise MCQ
66 pages
ResPaper ICSE Class X Prelims 2024 Computer Applications (Thakur Public School (TPS) Mumbai) Prelim 2
PDF
No ratings yet
ResPaper ICSE Class X Prelims 2024 Computer Applications (Thakur Public School (TPS) Mumbai) Prelim 2
6 pages
Paper (2015-16)
PDF
No ratings yet
Paper (2015-16)
4 pages
07 Lecture Iterative Statements
PDF
No ratings yet
07 Lecture Iterative Statements
14 pages
24.class Xii CS Qp-Patna-Region
PDF
No ratings yet
24.class Xii CS Qp-Patna-Region
9 pages
PB QP Set B
PDF
No ratings yet
PB QP Set B
9 pages
Ai (X) Practice Paper 4
PDF
No ratings yet
Ai (X) Practice Paper 4
4 pages
AI Project Cycle Work Sheet
PDF
No ratings yet
AI Project Cycle Work Sheet
3 pages
MCQ On Programming With Python 600145a4d624dd545f6af7f7
PDF
No ratings yet
MCQ On Programming With Python 600145a4d624dd545f6af7f7
19 pages
Sahil Sharma C.S Token
PDF
No ratings yet
Sahil Sharma C.S Token
16 pages
12th INFORMATIC PRACTICES SET 1
PDF
No ratings yet
12th INFORMATIC PRACTICES SET 1
5 pages
Mark Scheme Resolving Past Paper Questions Jan 2002 To Jan 2009
PDF
No ratings yet
Mark Scheme Resolving Past Paper Questions Jan 2002 To Jan 2009
5 pages
XII-CS SET A-QP-CbeSSC-DEC 22
PDF
No ratings yet
XII-CS SET A-QP-CbeSSC-DEC 22
9 pages