0% found this document useful (0 votes)
18 views3 pages

6 Marks

The document outlines various programming tasks and questions related to Python, including list manipulation, method overloading, file handling, and exception handling. It also covers concepts such as inheritance, set functions, and class design. Additionally, it includes exercises for checking palindromes, generating random integers, and implementing user-defined exceptions.

Uploaded by

sunnygaikwad4747
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
0% found this document useful (0 votes)
18 views3 pages

6 Marks

The document outlines various programming tasks and questions related to Python, including list manipulation, method overloading, file handling, and exception handling. It also covers concepts such as inheritance, set functions, and class design. Additionally, it includes exercises for checking palindromes, generating random integers, and implementing user-defined exceptions.

Uploaded by

sunnygaikwad4747
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
You are on page 1/ 3

6 marks

Summer 22

a) Write the output of the following:

i)

>>> a = [2, 5, 1, 3, 6, 9, 7 ]

>>> a [ 2 : 6] = [ 2, 4, 9, 0]

>>> print (a)

ii)

>>> b = * “Hello” , “Good” +

>>> b. append ( “python” )

>>> print (b)

iii)

>>> t1 = [ 3, 5, 6, 7 ]

>>> print (t 1 [2])

>>> print (t 1 [–1])

>>> print (t 1 [2 :])

>>> print (t 1 [:])

b) Explain method overloading in python with example.

c) Write a program to open a file in write mode and append some contents at the end of file.

a) Explain package Numpy with example.

b) Write a program to implement the concept of inheritance in python.

c) Explain Try-except block used in exception handling in python with example.

Summer 23

a) Write a Python Program to check if a string is palindrome or not.

b) Write a Python program to calculate sum of digit of given number using function.
c) Write a Python Program to accept values from user in a list and find the largest number and smallest
number in a list

a) Explain any six set function with example.

b) Design a class student with data members : name, roll no., department, mobile no. Create suitable
methods for reading and printing student information.

c) With suitable example explain inheritance in Python

summer 24

a) Write the output for the following if the variable course = “Python”
>>> course [ : 3 ]
>>> course [ 3 : ]
>>> course [ 2 : 2 ]
>>> course [ : ]
>>> course [ -1 ]
>>> course [ 1 ]

b) Write a python program to generate five random integers between 10 and 50 using numpy library.

c) Write a Python program to create a class ‘Diploma’ having a method ‘getdiploma’ that prints “I got a
diploma”. It has two subclasses namely ‘CO’ and ‘IF’ each having a method with the same name that
prints “I am with CO diploma” and ‘I am with IF diploma’ respectively. Call the method by creating an
object of each of the three classes.

a) Explain multiple inheritance and write a python program to implement it.

b) Write a Python program to create user defined exception that will check whether the password is
correct or not.

c) Describe various modes of file object. Explain any three in detail.

Winter 24

a) Explain basic operation performed on set with suitable example.

b) How to write, import and alias modules.

c) Design a class student with data members; Name, Roll No., Address. Create suitable method for
reading and printing students details.

a) Determine various data types available in Python with example.

b) Write a Python program to read contents of first.txt file and write same content in second.txt file.
c) Explain Try-except-else-finally block used in exception handling in Python with example.

You might also like