67% found this document useful (6 votes)
35K views2 pages

Python (Previous Year Question Paper)

This document appears to be exam questions for a Python programming course. It contains: - Short answer questions testing Python concepts like tuples, lists, functions, and data types. - Longer questions asking students to write Python code to solve problems like checking for leap years, command line arguments, string formatting, and recursion. - Questions about Python concepts like classes, objects, exceptions, inheritance and database connectivity. - Students are asked to answer multiple choice and long answer questions covering a range of Python programming topics. Scoring and time limits are provided for the exam.

Uploaded by

Deepa Sahu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
67% found this document useful (6 votes)
35K views2 pages

Python (Previous Year Question Paper)

This document appears to be exam questions for a Python programming course. It contains: - Short answer questions testing Python concepts like tuples, lists, functions, and data types. - Longer questions asking students to write Python code to solve problems like checking for leap years, command line arguments, string formatting, and recursion. - Questions about Python concepts like classes, objects, exceptions, inheritance and database connectivity. - Students are asked to answer multiple choice and long answer questions covering a range of Python programming topics. Scoring and time limits are provided for the exam.

Uploaded by

Deepa Sahu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Registration No: -

Total Number of Pages: 02 MCA/20MC303


3 Semester Regular Examination: 2021-22
PYTHON PROGRAMMING
BRANCH: MCA
Time: 3 Hours
Max Marks: 100
Q Code: 1110
Answer Question No.1 (Part-) which is compulsory, any EIGHT from Part-I and any Two from
Pa:t-IlI.
The figures in the right hand margin indicate marks.

Purt-i
QNa co Level
Q1 Short Answer Type Qucstions (Answer All-10) (02x10)
VWhet will be printed when the following code executes? Justify. 2
Tuple = (College")

print(Tuple[2:])
1 What will be the output of the following Python code? Explain.
Tuple (College")
print(Tuple[2:4])
Discuss any TWO disacvantages of python programming.
The marks of a student on 6 subjects are stored in a list, list1-140, 36,
94, 87, 29, 45]. Write the code to find the list of failed subjects.
Consider 45 as the minimum mark to pass in a subject.
Write the output of the code snippet? Explain your answer.

list1 =-2,-1,0, 1,2]


list1[-1]
2 2 Write the python code snippet to find the number of distinct elements
of a list.
What is the length of the given tuple? t1=(1.2),(3,4,5)). Explain your 2
answer.

What is the role of python virtual machine?


2 Define anonymous function in python with suitable example.
2 Describe about 3 types of transfer statement: break, continue and 2
pass.
Part-II b
Q No CO Level
Focused-Short Answer Type Questions- (Answer Any Eight out of (06x08)
Q2
Twelve)
What are the different data types used in python. Describe 6 types of
data types.
Define class, object, reference variable, instance variable, static
varnable, class variable with suitable example
Define aray in Pythea. Write a program to create an array of 5
integer then append 29 at the end of the array then display the array
items
Wnte a program to find a given number is a leap year or not.
Wnte a program in python two receive two numbers using command
line argument and print their sum/multiplication according to the third
argument.
Wnte a program to convert a line available in 'sentence case" to
another line of "capitalize each word" format.
Wnte different accessing options of a list available in python with
examples.
Demonstrate operator aoverloading with a suitable example.
Wite a program in pthon to print the items of a given list using 6
recursion. (Not using any loop)
What is an exception? Write the code to handle TWO built-in
exceptions.
How user-defined excaptions are handled in python? Explain with a
suitable example.
Give a short note on it terfaces in python. Demonstrate with a suitable
example.

Pa:t-l
Q No Co Level
Long Answer Type Questions (Answer Any Two out of Four) (02x16)
a) How is a function defined in python? Wnite a python program to find
the factorial of a valid number.
b) Define the different aspects of conditional branching statements of
python. Assume your grading system is as follows. O: 91-100, E:81
90, A:71-80. Read a number from keyboard and find its GRADE
Q4 ) 2 Assume a list contains some duplicate numbers. Write a program to
find the numbers which are stored exactly TWO times.
b) Define exception? What do you mean by exception handling? What is
the need of finally block explain with example.
Explain different types of inheritance available in python. Describe
how super class constructors are overridden.
b) 2 Wnite a program to connect a database using python. Write a 10
program to create a table having some required attributes of a
student
Q6 a) Wite a program to demonstrate the use of multiple user-defined 10
exception blocks.
Comparea critical comparative analysis between JAVA and
PYTHON.

You might also like