100% found this document useful (1 vote)
498 views

Python Question Bank

The document contains sample questions from 5 units of the Python Programming subject. The questions cover topics like Python features, data types, operators, loops, arrays, functions, exception handling and file handling. Example programs are provided for many questions to demonstrate the related Python concepts.

Uploaded by

srikanth
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
498 views

Python Question Bank

The document contains sample questions from 5 units of the Python Programming subject. The questions cover topics like Python features, data types, operators, loops, arrays, functions, exception handling and file handling. Example programs are provided for many questions to demonstrate the related Python concepts.

Uploaded by

srikanth
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MALLA REDDY UNIVERSITY

(Telangana State Private Universities Act No.13 of 2020 and G.O.Ms.No.14, Higher Education (UE) Department)

Maisammaguda, Near Kompally, Hyderabad 500100. TS., India.


________________________________________________________
Subject: Python Programming (PP)
Subjective Question Bank

Unit I
1 a) Why Python is called as an Interpreted Language? Briefly explain about PVM with neat diagram
b) write short note on features of Python Programming which are
different from C programming
2 a) Distinguish between C and Python programming
b) list of the steps used to view the byte code of a python program
3 Summarize at least three functions, 5 methods and constructs used in Tuple data type
4 a) Classify the built-in data types based on mutable and immutable. Explain any one data type of
each with example.
b) list out the commands used to install the python packages and explain what are the advantages
of using packages
5 a) Explain the following built-in data types
I ) None II) Numeric III) Bool
b) Demonstrate the use of Indentation , Docstring and comments in python program with a
sample program
6 a) Describe list comprehension with an example program
b) state the use of constants, identifiers, reserve words and naming conventions

Unit II
1 Demonstrate the following with an example
i) Membership operator ii) identity operator
iii) Multivariable declaration iv) operator precedence and associativity
2 Describe about input and output statements with a sample program for each type of statement
3 a) What is a command line argument? Explain briefly how to implement it in python programming
with an example
b) Illustrate the for and while loop with an example program
4 a) Write a Python program to find the minimum number of notes (Sample of notes: 10, 20, 50,
100, 200 , 500 and 2000 ) against an given amount.
b) Explain elseif ladder in python programming
5 a) Write a Python program to count the number of even and odd numbers from a sequence of
numbers.
b) Write a program to Reverse The given Digits using python programming
6 a) What is an else suite? When this feature is helpful, explain with a sample program.
b) Explain the following statements with flowchart and sample program
i) break ii) continue iii) pass iv) Assert
Unit III
1 a) What is an array? Can we use List as a substitute of arrays. Jusify.
b) How to use array module in the program? What are the advantages of using Array module explain in
detail.
2 a) Explain the following with an simple program
i) Creating an array
ii) Accessing array elements
iii) Different ways to add an element in to array
iv) Different ways to delete an element from array
v) Searching an element
b) Write short notes on slicing an array in different ways
3 a) Mention the advantages of using Numpy module instead of array module?
b) Write short notes on the following
i) arrange ii) reshape iii)array of zeros and ones iv) dimensions v) slicing
c) Write a program to perform the following operations on 2 dimension matrix of 3x3 size
i) Addition ii) Subtraction iii) Multiplication iv) Transpose

Unit IV

1 a) Explain built-in functions with suitable examples?


b) Describe the advantages of user defined functions?

2 a) Demonstrate function recursion with an example program

3 a) Demonstrate the types of formal arguments in functions with a sample program


b) In python functions are always called by passing reference, Justify.

4 a) Define user defined function.


b) Create a simple user defined function to find the student percentage scored in 6 subject marks.
(Maximum marks for each subject 50)

5 a) What are Anonymous functions in python?


b) Demonstrate the use of Lambda functions with a sample code.

Unit V

1 a) Define the error. Distinguish between Compile Time Errors, Run-time Error and Logical
errors with example.

2 a) Why exception handling is more important in Python? Briefly explain try-except-else-finally


block.
b) Write a python program to handle the ZeroDivisonError exception.

3 a) Classify the Files in python with example.


b)Write a Python program to count number of lines, words and characters in a text file.

4 a) Write a short note on:


i)Advantages of storing data in a files ii) Importance of Closing file
iii) seek () functioniv) tell () function

5 a) Explain the File modes for opening a file in Python.


b) Write a Python program to know whether a file exists or not, if it is existed display the
content of a file.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy