• Teaching
    • Montessori Teacher Training 🔥
    • Yoga Teacher Training
  • Coding
    • Full Stack Development Course
    • Data Science Course
    • Python Programming Course
    • Software Testing Course
    • Architecting on AWS
  • Commerce
    • PwC Edge : Strategic Accounting and Finance Programme
    • ACCA Course
    • SAP Fico Course
    • Practical Accounting Course
    • SAP MM Course
    • HR Management Course in Kerala
  • Technical
    • Structural Design Course
    • Embedded Systems Software Engineering in Kerala
    • MEP Course
    • MEP QS Course
    • BIM Training Course
    • Quantity Survey Course
  • Finacademy
    • Forex Trading Course
    • Stock Market Course
    • Mutual Funds Course in Kerala
  • Digital Marketing
    • Digital Marketing Course
    • Performance Marketing Course
  • Language Learning
    • Spoken English Course
    • German Language Course
    • IELTS Exam Coaching
  • Exam Preparation
    • Kerala PSC Coaching
    • Kerala PSC LGS Coaching
    • KAS Coaching
    • Kerala PSC LDC Coaching
    • Kerala PSC LSGS Coaching
    • KPSC Industries Extension Officer Coaching
    • KPSC Technical Mechanical Coaching
    • KPSC Technical Electrical Coaching
    • Kerala PSC Technical Exam Preparation
    • KPSC Technical Civil Coaching
    • SBI PO Coaching
    • IBPS Clerk Coaching
    • IBPS PO Coaching
    • IBPS SO Coaching
    • Bank Exam Coaching
    • Lecturer in DIET Course
    • Kpsc HSA Coaching
    • KPSC LP UP Assistant Coaching
    • EMRS Coaching
    • KTET Coaching
    • SSC Coaching
    • SSC JE Coaching
    • SSC CGL Coaching
    • SSC CHSL Coaching
    • SSC MTS Coaching
    • UPSC Coaching
  • Health Care
    • DHA Course
    • OET Coaching
  • Other Exams
    • GATE Coaching
    • CAT Coaching
    • MAT Online Coaching
    • KMAT Online Coaching
Entri Blog
No Result
View All Result
Sunday, July 20, 2025
  • Kerala PSC
    • Kerala PSC General
      • Kerala PSC Exams
      • KAS Exam
      • Kerala PSC VEO Notification
      • Kerala Police SI
      • Kerala PSC LDC Notification
      • Kerala PSC Village Field Assistant Notification
      • Kerala PSC LD Typist Notification
      • Kerala PSC Food Safety Officer
      • Kerala PSC Excise Inspector Notification
      • Kerala PSC BDO Notification
      • Kerala PSC CPO Notification
      • Kerala PSC LGS Notification
      • Fire and Rescue Officer
      • Women Fire and Rescue Officer
    • Kerala PSC Teaching
      • Kerala PSC HSA
      • Kerala PSC HSST
      • KTET
      • LP/UP Assistant
      • KVS
      • Railway Teacher
    • Kerala PSC Technical
      • LSGD AE
      • Draftsman/Overseer
      • IEO
      • ATP
      • Polytechnic Lecturer
      • AE Electronics
      • Assistant Engineer
  • Banking
    • IBPS PO Notification
    • IBPS Clerk Notification
    • SBI PO Notification
    • SBI Clerk Notification
    • SBI SO Notification
    • SBI Apprentice Notification
    • Canara Bank PO Notification
    • Indian Bank PO Notification
    • RBI Assistant Notification
    • RBI Office Attendant Notification
    • IBPS RRB Notification
    • IBPS RRB Office Assistant Notification
  • Skilling
    • Coding
    • Spoken English
    • Stock Market
      • Share Market Today News
      • Share Market Analysis
    • Digital Marketing
    • Accounting Course
    • SAP
    • OET
    • German
    • IELTS
    • Quantity Survey
    • MEP
    • Structural Design
    • Montessori
    • Yoga Teaching
    • Oil and Gas
  • Courses
    • Data Science Course
      • Data Science Malayalam
      • Data Science Course in Tamil
      • Data Science Course in Telugu
      • Data Science Training in Kochi
      • Data Science Training in Trivandrum
      • Data Science Course in Calicut
      • Data Science Training in Thrissur
    • Data Analytics Course
      • Data Analytics Course in Malayalam
      • Data Analytics Course in Tamil
      • Data Analytics Course in Telugu
    • BIM Course in Kerala
    • Quantity Surveying Course
      • Quantity Surveyor Course in Tamil
      • Quantity Surveying Course in Telugu
      • Quantity Surveyor Course in Hyderabad
      • Quantity Surveying Course in Chennai
      • Quantity Surveying Course in Vijayawada
      • Quantity Surveying Course in Guntur
      • Quantity Surveying Course in Warangal
      • Quantity Surveying Course in Karimnagar
    • Structural Design Course
      • Steel Structure Design Course
      • RCC Design Course
    • MEP Course
      • MEP Quantity Surveying Course
      • MEP Design Course in Kerala
      • HVAC Course
      • MEP Course in Kochi
    • Embedded System Course
    • Full Stack Developer Course
      • Full Stack Development Malayalam
      • Full Stack Development Hindi
      • Full Stack Development Tamil
      • Full Stack Development Telugu
      • Full Stack Development Kannada
    • Stock Market Course
      • Stock Market Course in Malayalam
      • Stock Market Course in Tamil
      • Stock Market Course in Kannada
      • Options Trading Course
    • Mutual Funds Course in Kerala
    • Mutual Funds Course in Tamil
    • Forex Trading Course
    • Spoken English Course
      • Spoken English Course in Malayalam
      • Spoken English Course in Hindi
      • Spoken English Course in Telugu
      • Spoken English Course in Tamil
      • Spoken English Course in Kannada
    • Python Programming Course
    • AI Powered Flutter
    • Ui Ux Designer Course
    • Software Testing Course
      • Software Testing Course in Malayalam
      • Software Testing Course in Tamil
      • Software Testing Course in Telugu
    • AWS Solutions Architect Associate Course
    • PwC Edge : Strategic Accounting and Finance Programme
    • Practical Accounting Course
      • Accounting Course in Malayalam
      • Accounting Course in Tamil
      • Tally Course
      • Taxation Course
      • UAE Accounting
      • GST Course
      • Zoho Books Training
      • GST Practitioner Course in Kerala
      • GCC VAT Course
    • ACCA Training Online
      • ACCA Course in Kerala
    • SAP Training Courses
      • SAP FICO Course
      • SAP MM Course
      • SAP SD Training
      • SAP FICO Course in Tamil
      • SAP MM Course in Tamil
    • HR Management Course
    • Performance Marketing Course
    • Mern Stack Developer Course
      • Full Stack Developer Course in Kochi
      • Full Stack Developer Course in Trivandrum
      • Full Stack Developer Course in Calicut
      • Full Stack Developer Course in Pune
      • Full Stack Developer Course in Bangalore
      • Full Stack Developer Course in Hyderabad
      • Full Stack Developer Course in Chennai
      • Full Stack Developer Course in Indore
      • Full Stack Developer Course in Jaipur
      • Full Stack Developer Course in Coimbatore
    • Digital Marketing Training
      • Digital Marketing Course in Kochi
      • Digital Marketing Course in Trivandrum
      • Digital Marketing Course in Calicut
      • Digital Marketing Course in Kollam
      • Digital Marketing Course in Thrissur
      • Digital Marketing Course in Kottayam
      • Digital Marketing Course in Kannur
    • Montessori Teacher Training
      • Montessori Teacher Training in Calicut
      • Montessori Teacher Training in Kochi, Ernakulam
      • Montessori Teacher Training in Trivandrum
      • Montessori Teacher Training in Kollam
      • Montessori Teacher Training in Malayalam
      • Montessori Teacher Training in Kannada
    • Other Courses
      • German Language Course
      • OET Coaching
        • OET for Pharmacist
        • OET for Nurses
      • DHA Course
      • MOH Exam Coaching
      • Nurses Recruitment Abroad
      • FMGE Coaching
      • ChatGPT Course
      • Forex Trading Course
      • Yoga Teacher Training Course
      • Diploma in Early Childhood Care and Education
      • Business Administration & Hospital Management Course
      • Hospital and Healthcare Administration
      • AI for Teachers Course
  • Others
    • Railway
      • RRB Technician Notification
      • RRB JE Notification
      • RRB ALP Notification
      • RRB NTPC Notification
      • RRB RPF Notification
      • RRB RPF SI Notification
      • RRB RPF Constable Notification
      • RRB Group D Notification
      • RRB RPSF SI Notification
      • RRB SSE Notification
    • SSC
      • SSC CPO Notification
      • SSC MTS Notification
      • SSC CGL Notification
      • SSC CHSL Notification
      • SSC GD Constable Notification
      • SSC Stenographer Notification
      • SSC JE Notification
      • SSC CAPF Notification
      • SSC JHT Notification
      • Delhi Police Constable Notification
      • Delhi Police SI Notification
    • GATE
    • MAT
    • KMAT
      • KMAT Kerala 2024
    • TET
      • APTET
      • CTET
      • DSSSB
      • Karnataka TET
      • Kerala TET
        • KTET Notification
      • KVS
      • MPTET
      • SUPER TET
      • TNTET
      • TSTET
      • UPTET
    • UPSC
      • UPSC CAPF Notification
      • UPSC CDS Notification
      • UPSC NDA Notification
      • UPSC Civil service Notification
  • Free Learn
    • Free Courses
      • Free Coding Courses
        • C Langauge Courses
        • Free Data Science Courses
        • Free Python Programming Courses
        • Free Full Stack Developer Courses
      • Free Accounting Courses
      • Free Digital Marketing Courses
        • Free SEO Courses
        • Web Development for Marketers
      • Engineering Upskilling Courses
      • Free Hospital Administration Courses
      • Free OET Training
      • Free SAP Courses
      • Free German Courses
      • Free IELTS Courses
      • Free Teachers Training Courses
      • Free Trading Courses
        • Free Stock Market Courses in Malayalam
        • Free Options Trading Course Malayalam
        • Free Forex Trading Courses Malayalam
        • Free Personal Finance Courses Malayalam
    • Question Answer
    • Aptitude Questions
    • Webinars
  • Test Prep
    • Kerala PSC Coaching
      • KPSC Degree Level Exam Preparation
      • Kerala PSC 12th Level Exam Preparation
      • Kerala PSC 10th Level Exam Preparation
      • KAS Coaching
      • Kerala PSC LDC Coaching
      • Kerala PSC LD Typist Coaching
      • Kerala PSC Fireman Coaching
      • KSFE Assistant Exam Preparation
      • Secretariat Office Attendant Coaching
      • Secretariat Assistant Coaching
      • Kerala PSC SI Exam Coaching
      • Khadi Board LDC Exam Preparation
      • Devaswom Board LDC Coaching
      • University LGS Exam Preparation
      • University Assistant Exam Coaching
      • KPSC Scientific Officer Exam Coaching
      • KPSC Probation Officer Grade II
      • KPSC Food Safety Officer Coaching
      • KWA Sanitary Chemist Coaching
      • KPSC Diary Farm Instructor Exam Coaching
      • Kerala PSC KWA Lab Assistant Exam Coaching
      • Kerala PSC ICDS Supervisor Exam Coaching
      • KPSC Finger Print Searcher Coaching
      • Kerala PSC Welfare Officer Gr. II Exam Coaching
      • KPSC Assistant Dental Surgeon Coaching
    • KPSC Teaching Exams
      • HSA Exam Preparation
      • KPSC HSA Social Science Coaching
      • KPSC HSA Physical Science Coaching
      • KPSC HSA English Coaching
      • KPSC Junior Language Teacher Hindi
      • KTET Coaching
      • SET Coaching
      • LP/UP Assistant Exam Coaching
      • HSST Exam Preparation
      • HSST Commerce Exam Coaching
      • Kerala PSC Lecturer in Diet Coaching
      • KVS PGT/TGT Coaching
    • Kerala PSC Technical Exams Coaching
      • Assistant Engineer Electrical Exam Coaching
      • Assistant Engineer Electronics Coaching
      • Assistant Engineer Mechanical Coaching
      • Kerala PSC Industries Extension Officer Coaching
      • KPSC LSGD AE Exam Coaching
      • KPSC Civil Engineering Exam Coaching
      • KPSC Mechanical Engineering Exam Coaching
      • KPSC Electrical Engineering Exam Coaching
      • KPSC Electronics Engineering Exam Coaching
      • KPSC Technical Computer Science Coaching
      • KPSC Tradesman Turning Coaching
      • Kerala PSC Overseer Exam Coaching
      • KPSC Assistant Town Planner Coaching
      • Lecturer in Polytechnic Electronics Coaching
    • Teaching Exams Coaching
      • CSIR NET Exam Coaching
      • EMRS Coaching
      • CTET Exam Online Coaching
    • IELTS Training Online
    • Bank Exam Coaching Online
      • SEBI Grade A Coaching
      • IBPS SO Online Coaching
      • IBPSC PO Online Coaching
      • IBPSC Clerk Online Coaching
      • SBI PO Coaching
      • SBI Clerk Online Coaching
      • SBI Apprentice Class
      • SBI SO Online Coaching
      • RBI Grade B Coaching
      • RBI Assistant Coaching
      • CSEB Exam Coaching
      • IBPS RRB Coaching
      • IBPS RRB PO Coaching
      • Canara Bank Po Exam Coaching
      • Kerala Gramin Bank Coaching
      • Kerala Bank Exam Coaching
        • Kerala Bank Clerk Exam Coaching
        • Kerala Bank Office Attendant Exam Coaching
        • Kerala Bank Assistant Manager Exam Coaching
      • JCI Exam Coaching
      • NABARD Grade A Coaching
      • LIC AAO Coaching Online
    • UPSC Online Coaching
      • UPSC CAPF Online Coaching
    • SSC Online Coaching
      • SSC JE Online Coaching
      • SSC CGL Coaching
      • SSC CGL AAO Coaching
      • SSC CHSL Coaching
      • SSC CGL CBI Inspector Coaching
      • SSC MTS Coaching
      • SSC Stenographer Coaching
      • SSC GD Online Coaching
    • RRB Exams Coaching
      • RRB RPF Exam Coaching
      • RRB NTPC Exam Coaching
      • RRB JE Online Coaching
      • RRB JE Electronics Coaching
      • RRB ALP Exam Coaching
      • RRB Technician Exam Coaching
    • CAT Online Coaching
    • CMAT Online Coaching
    • XAT Exam Coaching
    • GATE Online Coaching
      • GATE CE Online Coaching
      • GATE ME Online Coaching
      • GATE EE Online Coaching
    • NMAT Exam Coaching
      • AAI ATC Jr Executive Coaching
    • Cochin Shipyard Executive Trainee Coaching
    • BEL Probationary Engineer Coaching
    • HPCL Junior Executive Coaching
Free Courses
Entri Blog
  • HTML Tutorial
  • DSA Tutorials
  • Tutorials in Hindi
    • HTML Tutorial for Beginners in Hindi
    • Python Tutorial for Beginners in Hindi
    • GIT and GITHUB Tutorial for Beginners in Hindi
  • Tutorials in Tamil
    • JavaScript Tutorial in Tamil
  • Tutorials in Telugu
    • HTML Tutorial For Beginners in Telugu
    • CSS Tutorial for Beginners in Telugu
    • Bootstrap Tutorial for Beginner in Telugu
  • Tutorials in Kannada
    • HTML Tutorial For Beginners in Kannada
entri exclusive offers entri exclusive offers
Home Articles

Top Python MCQ Questions and Answers (Updated)

by Sabira Ulfath
July 6, 2024
in Articles, Python Programming
Top Python MCQ Questions and Answers (Updated)
Share on FacebookShare on WhatsAppShare on Telegram

Table of Contents

  • Introduction
  • Why Learn Python
  • Top Python MCQ Questions and Answers

Python is a high-level programming language that comes with dynamic binding and high-level built-in data structures. It is an object-oriented programming language that is interpreted. Python MCQ stands out among other programming languages because of its simple syntax, which is easy to write and comprehend for both novices and experts. Python’s wide range of applications and library support make it possible to create incredibly flexible and scalable software and products on top of it in the real world.

You can find a large variety of Python MCQ (Multiple Choice Questions) covering a broad spectrum of Python programming subjects in this article. These Python MCQ (multiple-choice questions) cover basic to advanced subjects, letting you assess your understanding of concepts including operators, data types, functions, grammar, and best practices.

Experience the power of our python programming course with a free demo – enroll now!

Introduction

Guido van Rossum created Python, which was initially made available on February 20, 1991. Being interpretive in nature, it is one of the most popular and frequently used programming languages, offering flexibility in integrating dynamic semantics. It has a relatively straightforward syntax and is free and open-source. Python learning is made easier for developers as a result. And Python is mostly used for general-purpose programming, but it can also support object-oriented programming.

The Python is becoming more and more popular because of its ease of use and capacity to accomplish more tasks with fewer lines of code. Python’s ability to enable strong calculations utilising strong libraries makes it useful in a variety of other disciplines, including machine learning, artificial intelligence, web development, and web scraping.

Why Learn Python

Python is a high-level, free, open-source programming language with an easy-to-learn syntax that is perfect for developers. The most recent version of the Python programming language, version 3, is utilized in machine learning applications, web development, and every other cutting-edge software industry technology.

1. Data Science

The majority of data scientists use Python as their programming language of choice. These days, data is used in every job and is essential to its operation, whether it be in marketing, software development, or IT operations. Python gained popularity in the data sector with the advent of “Numpy” and “Pandas.” Along with handling statistical, tabular, and matrix data, Python also uses libraries like “Matplotlib” and “Seaborn” to visualize it.

2. Easy to Learn

Python is a simple language to learn. This is primarily due to the language’s similarity to English. The syntax of Python is defined by a small number of special circumstances and rules. It’s safe to argue that Python places more emphasis on your intended use of the code than on linguistic nuances. Python is easily mastered by everyone. This programming language’s readability and speed are other appealing features.

3. Cross-Platform and Open Source

This language has been available as open source and cross-platform for more than 20 years. Python code is compatible with all operating systems, including Windows, Linux, and MacOS. Python’s support for decades of bug-squashing and kink-straightening assures that its code functions as intended every time the user runs it, which is another amazing feature of the language.

4. Versatile Language and Platform

Python’s continued relevance stems from its ability to be used in a wide range of operations and software development scenarios. It can be used to manage both local and cloud infrastructure, work with SQL databases, create custom functions for Hive & Pig, support object-oriented design, or even create simple user tools.

5. Vast Libraries

Python is supported via PyPI, which offers the user access to over 85,000 Python scripts and modules. Users can access pre-packaged functionality in their local Python environment by using these modules.It can handle a wide range of issues, including machine vision, sentiment analysis, and complex data analytics tasks like creating REStful web services.

6. Flexibility

When combined with other programming languages, Python offers a number of strong applications. Here are some details about them:

  • IronPython is compatible with C# and.Net.
  • An instance using C: CPython
  • Ruby and Python together: RubyPython
  • Python that is combined with Java:
  • Python coded with PyObjc, an Objective C toolbox

7. High Salary

When compared to other professionals in the business, Python engineers receive a somewhat better income. The average yearly salary for a Python developer INR is approximtely up to 951426 INR. Python has a great earning potential because it is widely used in many different areas, such as technology, healthcare, finance, and more.

8. Artificial Intelligence

In the field of artificial intelligence (AI), Python excels. Python’s libraries, such as Keras and TensorFlow, make it possible to develop intricate deep learning and machine learning algorithms. Python’s NLTK and spaCy are excellent at tasks like sentiment analysis and language translation, which is why these libraries are commonly used in AI applications like natural language processing (NLP).

9. Testing Framework

For established businesses, this language is a great tool for verifying concepts or goods. Numerous testing frameworks for troubleshooting and quick workflows are built into Python. Its modules and tools, such Splinter and Selenium, function to simplify tasks. Python is also capable of supporting cross-browser and cross-platform testing thanks to frameworks like Robot and PyTest.

10. Web Development

Python offers many frameworks for building websites and web applications. Python offers many frameworks for creating web applications. Python is used to write popular frameworks like Django, Flask, and Pylons, which are known for their speedier and more reliable code. Users can execute web scraping—that is, obtaining information from other websites—by using Python.

Experience the power of our python programming course with a free demo – enroll now!

Top Python MCQ Questions and Answers

1. What is the longest Python identifier that can be?

A. 32

B. 16

C. 128

D. No fixed length is specified.

Answer: [D]. For a Python identifier, there is no default set fixed length.

2. What will the following little bit of code produce?

print(2**3 + (5 + 6)**(1 + 1))

A. 129

B. 8

C. 121

D. None of the above.

Answer: [A]. The code above will print 129 by adhering to the operator precedence BEDMAS rule.

3. Which datatype would the variable in the code line below be?
var = 10
print(type(var))
var = "Hello"
print(type(var))

A. str and int

B. int and int

C. str and str

D. int and str

Answer: [D] Var is of type int and initially stores 10. It then stores the string “Hello” after that.

4. How is a code block indicated in Python?

A. Brackets.

B. Indentation.

C. Key.

D. None of the above.

Answer: [C] Indentation is used to indicate a Python code block.
5. When the following code snippet runs, what will happen?
x = [1, 2, 3]
x = tuple(x)
x[0] = 2
print(x)

A. [2, 2, 3]

B. (2, 2, 3)

C. (1, 2, 3)

D. Error.

Answer: [D] Tuples are immutable, thus if we convert a to a and then try to change its content, we will receive an error.

6. What will be the output of the following code?
print(type(7 / 2))
print(type(7 // 2))

A. float and int

B. int and float

C. float and float

D. int and int

Answer: [A] Because the first expression divides using normal methods, the result is saved as a float type. Since the second expression divides an integer, the result is saved as an int type.

7. Define, what will be the output of the following code?
x = [1, 2, 3, 4, 5]
sum = 0
for ele in x:
   sum += ele 
print(sum)

A. 15

B. 0

C. 20

D. None of these

Answer:  [A] The code above determines the total of each item in the list.

8. Define, what will be the output of the following code?
x = 3
y = 1 
print(x, y)
x, y = y, x 
print(x, y)

A. 3 1    1 3

B. 3 1    3 1

C. 1 3    1 3

D. 1 3    3 1

Answer:  [A] The Python code snippet above switches two numbers.

9. What will be the output of the following code?
x = [1, 2]
print(x * 3)

A. Error

B. [1, 2]

C. [1, 2, 1, 2]

D. [1, 2, 1, 2, 1, 2]

Answer: [D] Python overloads the * operator to carry out list replication operations. Thus, the identical list is duplicated three times in total.

10. Which of the following loop types does Python not support?

A. for

B. while

C. do-while

D. None of the above

Answer: [C] Python does not specifically include do-while loops.

Experience the power of our python programming course with a free demo – enroll now!

11. What will be the output of the following code?
sample = ["Sunday", "Monday", "Tuesday", "Wednesday"];
del sample[2]
print(sample)

A. [‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’]

B. [‘Sunday’, ‘Monday’, ‘Wednesday’]

C. [‘Monday’, ‘Tuesday’, ‘Wednesday’]

D. [‘Sunday’, ‘Monday’, ‘Tuesday’]

Answer: [B] An item at a specified index can be removed from a list using the del keyword.

12. Which of the following is the correct syntax for determining whether a specific element exists in a list?

A. if ele in list

B. if not ele not in list

C. Both A and B

D. None of the above

Answer: [C] It is acceptable to use either A or B to check if an element is present in a list.

13. In the code snippet below, what kind of variable called sorted_numbers would it be?
num = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_num = sorted(num)
print(sorted_num)

A. List

B. Tuple

C. String

D. Int

Answer: [A] The list that the sorted() function produces has every element in the arguments arranged in the desired order.

14. What will be the output of the following code?
def thrive(x):
 if x % 15 == 0:
   print("thrive", end = “ ”)
 elif x % 3 != 0 and n % 5 != 0:
   print("neither", end = “ ”)
 elif x % 3 == 0:
   print("three", end = “ ”)
 elif x % 5 == 0:
   print("five", end = “ ”)
thrive(35)
thrive(56)
thrive(15)
thrive(39)

A. five neither thrive three

B. five neither three thrive

C. three three three three

D. five neither five neither

Answer: [A] Three and five print multiples are very popular. No multiples of three or five prints are available. Prints in multiples of three (3) and five (5) are available.

15. What will be the output of the following code?
num = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_num = sorted(num)
even = lambda x: x % 2 == 0
even_numbers = filter(even, sorted_numbers)
print(type(even_numbers))

A. filter

B. int

C. list

D. tuple

Answer: [A] An object of type “filter” is returned by the filter function.

16. What will be the output of the following code?
num = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_num = sorted(num)
odd_numbers = [y for y in sorted_numbers if y % 2 != 0]
print(odd_numbers)

A. [7, 19, 45, 89]

B. [2, 4, 22, 72]

C. [4, 7, 19, 2, 89, 45,72, 22]

D. [2, 4, 7, 19, 22, 45, 72, 89]

Answer: [A] By sorting the odd numbers in the numbers list, the code above essentially creates a list of those numbers.

17. What will be the output of the following code?
def check(x):
   print("Even" if x % 2 == 0 else "Odd")
   
check(12)

A. Even

B. Odd

C. Error

D. None

Answer: [A] The software determines whether a given number is even or not by using ternary operators.

18. What will be the output of the following code?
sample = ["Sunday", "Monday", "Tuesday", "Wednesday"];
print(sample[-3:-1])

A. [‘Monday’, ‘Tuesday’]

B. [‘Sunday’, ‘Monday’]

C. [‘Tuesday’, ‘Wednesday’]

D. [‘Wednesday’, ‘Monday’]

Answer: [A] This is an illustration of list slicing using negative indices. Here, [-3:-1] denotes slicing the list’s second and third indexes (using 1-based indexing).

19. What will be the output of the following code?
def is_even(num):
  message =  f"{num} is an even number" if num % 2 == 0 else  f"{num} is an odd number"
 return message
print(is_even(54))

A. 54 is an even number

B. 54 is an odd number

C. number is an even number

D. number is an odd number

Answer: [A] Python’s f strings provide a way to format strings. The values of the parameters are substituted for the parts surrounded in {}.

20. What will be the output of the following code?
example1 = {'first' : 'sunday', 'second' : 'monday'}
example2 = {1: 3, 2: 4}
example1.update(example2)
print(example1)

A. {‘first’: ‘sunday’, ‘second’: ‘monday’, 1: 3, 2: 4}

B. {‘first’: ‘sunday’, ‘second’: ‘monday’}

C. {1: 3, 2: 4}

D. None of the above

Answer: [A] Two dictionaries’ contents are combined by Python’s update function and saved in the invoking dictionary.

21. Define, What will be the output of the following code?
a = {1, 2, 3, 3, 2, 4, 5, 5}
print(a)

A. {1, 2, 3, 3, 2, 4, 5, 5}

B. {1, 2, 3, 4, 5}

C. None

D. {1, 5}

Answer: [B] Python sets only contain unique elements; they don’t contain any repetitions.

22.  What will be the output of the following code?
x = {'welcome':'Home', 'First': 1}
y = {val: z for z , val in x.items()}
print(y)

A. {‘Welcome’:’Home’, ‘First’: 1}

B. {‘Welcome’: ‘Home’, 1: ‘First’}

C. Can be both A or B

D. None of the above

Answer: [B] In this Python dict comprehension example, the key-value pairs from the first dictionary are reversed and placed in the second.

23. Which of the following Python programs converts a date to the appropriate time?

A. strptime()

B. strftime()

C. Both A and B

D. None of the above

Answer: [A] Python’s strptime() method translates a date to the matching time.

24. What will be the output of the following code?
word = "Hello world"
n = len(word)
word1 = word.upper()
word2 = word.lower()
converted_word = ""
for i in range(n):
 if i % 2 == 0:
   converted_word += word2[i]
 else:
   converted_word += word1[i]
print(converted_word)

A. heLlo WoRLd

B. Hello World

C. hello world

D. HELLO WORLD

Answer: [A] We change all elements in odd index to lower case and all elements in even index to uppercase in this bit of code.

25. What will be the output of the following code?
x = "4, 5"
nums = x.split(',')
a, b = nums
int_prod = int(a) * int(b)
print(int_prod)

A. 20

B. 45

C. 54

D. 4,5

Answer: [A] This line of code divides the given string into two integer components, treating them as integer types, and then finds their product.

Experience the power of our python programming course with a free demo – enroll now!

Share70SendShare

Sabira Ulfath

Related Posts

Why Is It Important to Have an Extra Source of Income
Articles

Why Is It Important to Have an Extra Source of Income?

July 19, 2025
Top Automation Tools Manual Testers Should Master
Articles

Top Automation Tools Manual Testers Should Master

July 19, 2025
Manual Tester to Automation Tester Skills You Must Learn
Articles

Manual Tester to Automation Tester: Skills You Must Learn

July 19, 2025
Next Post
Kerala PSC Khadi LDC Previous Question Paper PDF - Prelims & Mains

Kerala PSC LDC Khadi Previous Question Paper PDF - Prelims & Mains

More to Explore

  1. Future of Python Developers
  2. Python Online Course with 100% Placement
  3. Steps To Code A Video Conferencing App Using Python
  4. Python Advanced Interview Questions and Answers
  5. Introduction to Data Visualization in Python
  6. Python developer – Skills, Courses, Job Roles
  7. Python Developer Salary in India
  8. Method Overloading in Python

Practice Programs

  1. Program for Finding Factorial of a Number in Python
  2. Python Program to Convert Decimal to Binary Number
  3. Python Program for Fibonacci Series
  4. Prime Number Program in Python
  5. Python Program to Check Armstrong Number

Python Training in Different Cities

  1. Python Training in Kochi
  2. Python Training in Trivandrum
  3. Python Training in Calicut

Free Tutorials For You

  1. SQL Tutorial for Beginners PDF
  2. Python Tutorial for Beginners in Hindi
  3. GIT and GITHUB Tutorial for Beginners in Hindi
  4. HTML Exercises to Practice
  5. JavaScript Tutorial in Tamil
  6. DSA Practice Series
  7. Microsoft Excel Malayalam Tutorial
  8. Learn Bootstrap in Tamil
  9. Introduction to CSS in Malayalam
  10. Introduction to JavaScript in Malayalam
  11. Java Programming Notes PDF
  12. Introduction to HTML in Malayalam

Courses

  • Data Science Course
  • Full Stack Developer Course
  • Software Testing Course
  • Data Science Course in Malayalam
  • Full Stack Developer Course in Malayalam
  • Full Stack Developer Course in Hindi
  • Full Stack Developer Course in Tamil
  • Full Stack Developer Course in Telugu
  • Full Stack Developer Course in Kannada
  • Python Programming Course
  • Practical Accounting Course
  • Structural Design Course
  • Quantity Surveying Course
  • Embedded Systems Course in Kerala
  • BIM Course
  • MEP Course
  • MEP QS Course
  • Stock Market Course
  • Stock Market Course in Malayalam
  • Stock Market Course in Tamil
  • Stock Market Course in Kannada
  • Forex Trading Course
  • Mutual Funds Course in Kerala
  • Mutual Funds Course in Tamil
  • PwC Edge : Strategic Accounting and Finance Programme
  • SAP FICO Training
  • SAP MM Training
  • SAP SD Training
  • ACCA Online Course
  • HR Management Course

Company

  • Become a teacher
  • Login to Entri Web

Spoken English Courses

  • Spoken English Course
  • Spoken English Course in Malayalam
  • Spoken English Course in Hindi
  • Spoken English Course in Tamil
  • Spoken English Course in Telugu
  • Spoken English Course in Kannada
  • Spoken English Course for Housewives
  • Spoken English Course for Working Professionals
  • Spoken English Course for School Students
  • Spoken English Course for College Students
  • Spoken English Course for Job Seekers
  • AI Powered Spoken English Course

Quick Links

  • Explore Free Courses
  • Aptitude Questions
  • Articles
  • Videos
  • Entri Daily Quiz Practice
  • Current Affairs & GK
  • News Capsule – eBook
  • Preparation Tips
  • Kerala PSC Gold
  • Entri Skilling
  • Kerala PSC

Other Courses

  • OET Coaching Classes
  • DHA Course
  • Nurse Recruitment Abroad
  • Montessori Teachers Training
  • Performance Marketing Course
  • German Language Course
  • Yoga Teacher Training Course
  • Digital Marketing Course
  • Options Trading Course
  • German Language A1 Course
  • German Language A2 Course
  • German Language B1 Course
  • German Language B2 Course
  • Diploma in Early Childhood Care and Education
  • Hospital and Healthcare Administration
  • Business Administration & Hospital Management
  • Hospital and Healthcare Administration

Popular Exam

  • IBPS Exam
  • SBI Exam
  • Railway RRB Exam
  • Kerala PSC
  • Tamil Nadu PSC
  • Telangana PSC
  • Andhra Pradesh PSC
  • MPPSC
  • UPPSC
  • Karnataka PSC
  • Staff Selection Commission Exam
  • GATE

© 2023 Entri.app - Privacy Policy | Terms of Service

No Result
View All Result
  • Kerala PSC
    • Kerala PSC General
      • Kerala PSC Exams
      • KAS Exam
      • Kerala PSC VEO Notification
      • Kerala Police SI
      • Kerala PSC LDC Notification
      • Kerala PSC Village Field Assistant Notification
      • Kerala PSC LD Typist Notification
      • Kerala PSC Food Safety Officer
      • Kerala PSC Excise Inspector Notification
      • Kerala PSC BDO Notification
      • Kerala PSC CPO Notification
      • Kerala PSC LGS Notification
      • Fire and Rescue Officer
      • Women Fire and Rescue Officer
    • Kerala PSC Teaching
      • Kerala PSC HSA
      • Kerala PSC HSST
      • KTET
      • LP/UP Assistant
      • KVS
      • Railway Teacher
    • Kerala PSC Technical
      • LSGD AE
      • Draftsman/Overseer
      • IEO
      • ATP
      • Polytechnic Lecturer
      • AE Electronics
      • Assistant Engineer
  • Banking
    • IBPS PO Notification
    • IBPS Clerk Notification
    • SBI PO Notification
    • SBI Clerk Notification
    • SBI SO Notification
    • SBI Apprentice Notification
    • Canara Bank PO Notification
    • Indian Bank PO Notification
    • RBI Assistant Notification
    • RBI Office Attendant Notification
    • IBPS RRB Notification
    • IBPS RRB Office Assistant Notification
  • Skilling
    • Coding
    • Spoken English
    • Stock Market
      • Share Market Today News
      • Share Market Analysis
    • Digital Marketing
    • Accounting Course
    • SAP
    • OET
    • German
    • IELTS
    • Quantity Survey
    • MEP
    • Structural Design
    • Montessori
    • Yoga Teaching
    • Oil and Gas
  • Courses
    • Data Science Course
      • Data Science Malayalam
      • Data Science Course in Tamil
      • Data Science Course in Telugu
      • Data Science Training in Kochi
      • Data Science Training in Trivandrum
      • Data Science Course in Calicut
      • Data Science Training in Thrissur
    • Data Analytics Course
      • Data Analytics Course in Malayalam
      • Data Analytics Course in Tamil
      • Data Analytics Course in Telugu
    • BIM Course in Kerala
    • Quantity Surveying Course
      • Quantity Surveyor Course in Tamil
      • Quantity Surveying Course in Telugu
      • Quantity Surveyor Course in Hyderabad
      • Quantity Surveying Course in Chennai
      • Quantity Surveying Course in Vijayawada
      • Quantity Surveying Course in Guntur
      • Quantity Surveying Course in Warangal
      • Quantity Surveying Course in Karimnagar
    • Structural Design Course
      • Steel Structure Design Course
      • RCC Design Course
    • MEP Course
      • MEP Quantity Surveying Course
      • MEP Design Course in Kerala
      • HVAC Course
      • MEP Course in Kochi
    • Embedded System Course
    • Full Stack Developer Course
      • Full Stack Development Malayalam
      • Full Stack Development Hindi
      • Full Stack Development Tamil
      • Full Stack Development Telugu
      • Full Stack Development Kannada
    • Stock Market Course
      • Stock Market Course in Malayalam
      • Stock Market Course in Tamil
      • Stock Market Course in Kannada
      • Options Trading Course
    • Mutual Funds Course in Kerala
    • Mutual Funds Course in Tamil
    • Forex Trading Course
    • Spoken English Course
      • Spoken English Course in Malayalam
      • Spoken English Course in Hindi
      • Spoken English Course in Telugu
      • Spoken English Course in Tamil
      • Spoken English Course in Kannada
    • Python Programming Course
    • AI Powered Flutter
    • Ui Ux Designer Course
    • Software Testing Course
      • Software Testing Course in Malayalam
      • Software Testing Course in Tamil
      • Software Testing Course in Telugu
    • AWS Solutions Architect Associate Course
    • PwC Edge : Strategic Accounting and Finance Programme
    • Practical Accounting Course
      • Accounting Course in Malayalam
      • Accounting Course in Tamil
      • Tally Course
      • Taxation Course
      • UAE Accounting
      • GST Course
      • Zoho Books Training
      • GST Practitioner Course in Kerala
      • GCC VAT Course
    • ACCA Training Online
      • ACCA Course in Kerala
    • SAP Training Courses
      • SAP FICO Course
      • SAP MM Course
      • SAP SD Training
      • SAP FICO Course in Tamil
      • SAP MM Course in Tamil
    • HR Management Course
    • Performance Marketing Course
    • Mern Stack Developer Course
      • Full Stack Developer Course in Kochi
      • Full Stack Developer Course in Trivandrum
      • Full Stack Developer Course in Calicut
      • Full Stack Developer Course in Pune
      • Full Stack Developer Course in Bangalore
      • Full Stack Developer Course in Hyderabad
      • Full Stack Developer Course in Chennai
      • Full Stack Developer Course in Indore
      • Full Stack Developer Course in Jaipur
      • Full Stack Developer Course in Coimbatore
    • Digital Marketing Training
      • Digital Marketing Course in Kochi
      • Digital Marketing Course in Trivandrum
      • Digital Marketing Course in Calicut
      • Digital Marketing Course in Kollam
      • Digital Marketing Course in Thrissur
      • Digital Marketing Course in Kottayam
      • Digital Marketing Course in Kannur
    • Montessori Teacher Training
      • Montessori Teacher Training in Calicut
      • Montessori Teacher Training in Kochi, Ernakulam
      • Montessori Teacher Training in Trivandrum
      • Montessori Teacher Training in Kollam
      • Montessori Teacher Training in Malayalam
      • Montessori Teacher Training in Kannada
    • Other Courses
      • German Language Course
      • OET Coaching
      • DHA Course
      • MOH Exam Coaching
      • Nurses Recruitment Abroad
      • FMGE Coaching
      • ChatGPT Course
      • Forex Trading Course
      • Yoga Teacher Training Course
      • Diploma in Early Childhood Care and Education
      • Business Administration & Hospital Management Course
      • Hospital and Healthcare Administration
      • AI for Teachers Course
  • Others
    • Railway
      • RRB Technician Notification
      • RRB JE Notification
      • RRB ALP Notification
      • RRB NTPC Notification
      • RRB RPF Notification
      • RRB RPF SI Notification
      • RRB RPF Constable Notification
      • RRB Group D Notification
      • RRB RPSF SI Notification
      • RRB SSE Notification
    • SSC
      • SSC CPO Notification
      • SSC MTS Notification
      • SSC CGL Notification
      • SSC CHSL Notification
      • SSC GD Constable Notification
      • SSC Stenographer Notification
      • SSC JE Notification
      • SSC CAPF Notification
      • SSC JHT Notification
      • Delhi Police Constable Notification
      • Delhi Police SI Notification
    • GATE
    • MAT
    • KMAT
      • KMAT Kerala 2024
    • TET
      • APTET
      • CTET
      • DSSSB
      • Karnataka TET
      • Kerala TET
      • KVS
      • MPTET
      • SUPER TET
      • TNTET
      • TSTET
      • UPTET
    • UPSC
      • UPSC CAPF Notification
      • UPSC CDS Notification
      • UPSC NDA Notification
      • UPSC Civil service Notification
  • Free Learn
    • Free Courses
      • Free Coding Courses
      • Free Accounting Courses
      • Free Digital Marketing Courses
      • Engineering Upskilling Courses
      • Free Hospital Administration Courses
      • Free OET Training
      • Free SAP Courses
      • Free German Courses
      • Free IELTS Courses
      • Free Teachers Training Courses
      • Free Trading Courses
    • Question Answer
    • Aptitude Questions
    • Webinars
  • Test Prep
    • Kerala PSC Coaching
      • KPSC Degree Level Exam Preparation
      • Kerala PSC 12th Level Exam Preparation
      • Kerala PSC 10th Level Exam Preparation
      • KAS Coaching
      • Kerala PSC LDC Coaching
      • Kerala PSC LD Typist Coaching
      • Kerala PSC Fireman Coaching
      • KSFE Assistant Exam Preparation
      • Secretariat Office Attendant Coaching
      • Secretariat Assistant Coaching
      • Kerala PSC SI Exam Coaching
      • Khadi Board LDC Exam Preparation
      • Devaswom Board LDC Coaching
      • University LGS Exam Preparation
      • University Assistant Exam Coaching
      • KPSC Scientific Officer Exam Coaching
      • KPSC Probation Officer Grade II
      • KPSC Food Safety Officer Coaching
      • KWA Sanitary Chemist Coaching
      • KPSC Diary Farm Instructor Exam Coaching
      • Kerala PSC KWA Lab Assistant Exam Coaching
      • Kerala PSC ICDS Supervisor Exam Coaching
      • KPSC Finger Print Searcher Coaching
      • Kerala PSC Welfare Officer Gr. II Exam Coaching
      • KPSC Assistant Dental Surgeon Coaching
    • KPSC Teaching Exams
      • HSA Exam Preparation
      • KPSC HSA Social Science Coaching
      • KPSC HSA Physical Science Coaching
      • KPSC HSA English Coaching
      • KPSC Junior Language Teacher Hindi
      • KTET Coaching
      • SET Coaching
      • LP/UP Assistant Exam Coaching
      • HSST Exam Preparation
      • HSST Commerce Exam Coaching
      • Kerala PSC Lecturer in Diet Coaching
      • KVS PGT/TGT Coaching
    • Kerala PSC Technical Exams Coaching
      • Assistant Engineer Electrical Exam Coaching
      • Assistant Engineer Electronics Coaching
      • Assistant Engineer Mechanical Coaching
      • Kerala PSC Industries Extension Officer Coaching
      • KPSC LSGD AE Exam Coaching
      • KPSC Civil Engineering Exam Coaching
      • KPSC Mechanical Engineering Exam Coaching
      • KPSC Electrical Engineering Exam Coaching
      • KPSC Electronics Engineering Exam Coaching
      • KPSC Technical Computer Science Coaching
      • KPSC Tradesman Turning Coaching
      • Kerala PSC Overseer Exam Coaching
      • KPSC Assistant Town Planner Coaching
      • Lecturer in Polytechnic Electronics Coaching
    • Teaching Exams Coaching
      • CSIR NET Exam Coaching
      • EMRS Coaching
      • CTET Exam Online Coaching
    • IELTS Training Online
    • Bank Exam Coaching Online
      • SEBI Grade A Coaching
      • IBPS SO Online Coaching
      • IBPSC PO Online Coaching
      • IBPSC Clerk Online Coaching
      • SBI PO Coaching
      • SBI Clerk Online Coaching
      • SBI Apprentice Class
      • SBI SO Online Coaching
      • RBI Grade B Coaching
      • RBI Assistant Coaching
      • CSEB Exam Coaching
      • IBPS RRB Coaching
      • IBPS RRB PO Coaching
      • Canara Bank Po Exam Coaching
      • Kerala Gramin Bank Coaching
      • Kerala Bank Exam Coaching
      • JCI Exam Coaching
      • NABARD Grade A Coaching
      • LIC AAO Coaching Online
    • UPSC Online Coaching
      • UPSC CAPF Online Coaching
    • SSC Online Coaching
      • SSC JE Online Coaching
      • SSC CGL Coaching
      • SSC CGL AAO Coaching
      • SSC CHSL Coaching
      • SSC CGL CBI Inspector Coaching
      • SSC MTS Coaching
      • SSC Stenographer Coaching
      • SSC GD Online Coaching
    • RRB Exams Coaching
      • RRB RPF Exam Coaching
      • RRB NTPC Exam Coaching
      • RRB JE Online Coaching
      • RRB JE Electronics Coaching
      • RRB ALP Exam Coaching
      • RRB Technician Exam Coaching
    • CAT Online Coaching
    • CMAT Online Coaching
    • XAT Exam Coaching
    • GATE Online Coaching
      • GATE CE Online Coaching
      • GATE ME Online Coaching
      • GATE EE Online Coaching
    • NMAT Exam Coaching
      • AAI ATC Jr Executive Coaching
    • Cochin Shipyard Executive Trainee Coaching
    • BEL Probationary Engineer Coaching
    • HPCL Junior Executive Coaching

© 2023 Entri.app - Privacy Policy | Terms of Service

Chat