[go: up one dir, main page]

0% found this document useful (0 votes)
6 views6 pages

PWP COMMON CODES

The document outlines programming exercises and questions for Python, categorized by academic terms from Summer 2022 to Winter 2024. It includes tasks related to loops, sets, classes, exception handling, and file operations, as well as common questions on similar topics. Additionally, it emphasizes the importance of crediting the author and prohibits unauthorized use of the content.

Uploaded by

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

PWP COMMON CODES

The document outlines programming exercises and questions for Python, categorized by academic terms from Summer 2022 to Winter 2024. It includes tasks related to loops, sets, classes, exception handling, and file operations, as well as common questions on similar topics. Additionally, it emphasizes the importance of crediting the author and prohibits unauthorized use of the content.

Uploaded by

dondanaitik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

PWP COMMON CODES

Summer 2024

1. Print the following pattern using loop:

1010101

10101

101

2. Write python program to perform following operations on set.


i) Create set of five elements
ii) Access set elements
iii) Update set by adding one element
iv) Remove one element from set.

3. Write a python program that takes a number and checks whether it is a


palindrome.
4. Write a python program to create a user defined module that will ask
your program name and display the name of the program.
5. Write a python program takes in a number and find the sum of digits in
a number.
6. Write a program function that accepts a string and calculate the
number of uppercase letters and lower case letters.
7. Write a python program to create class student with roll-no and display
its contents.
8. Write a python program to generate five random integers between 10
and 50 using numpy library.
9. 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.
Summer 2023
1. Explain creating Dictionary and accessing Dictionary Elements with
example.
2. Write a Python program to find the factorial of a number provided by
the user.
3. Write a python program to input any two tuples and interchange the
tuple variables.
4. Write a program to show user defined exception in Python.
5. Write a Python Program to check if a string is palindrome or not.
6. Write a Python program to calculate sum of digit of given number using
function.
7. Write a Python Program to accept values from user in a list and find the
largest number and smallest number in a list.
8. Design a class student with data members : name, roll no.,
department, mobile no. Create suitable methods for reading and
printing student information.
9. With suitable example explain inheritance in Python.

Summer 2022

1. Write a program to print following:


1
12
123
1234
2. Write a program to create class EMPLOYEE with ID and NAME and
display its contents.
3. Write a program for importing module for addition and substraction of
two numbers.
4. Write a program to create dictionary of students that includes their
ROLL NO. and NAME.
i) Add three students in above dictionary
ii) Update name = ‘Shreyas’ of ROLL NO = 2
iii) Delete information of ROLL NO = 1
5. Write a program illustrating use of user defined package in python.
6. Explain method overloading in python with example.
7. Write a program to open a file in write mode and append some
contents at the end of file.
8. Write a program to implement the concept of inheritance in python.
9. Explain Try-except block used in exception handling in python with
example.
10. Explain package Numpy with example
Winter 2024
1. Write a program illustrating use of user defined package in Python
2. Explain how to use user defined function in Python with example.
3. Illustrate with example method overloading
4. Write a Python program to check for zero division errors exception
5. Write a Python program to read contents from “a.txt” and write same
contents in “b.txt”
6. Explain basic operation performed on set with suitable example.
7. Design a class student with data members; Name, Roll No., Address.
Create suitable method for reading and printing students details.
8. Write a Python program to read contents of first.txt file and write same
content in second.txt file.

Winter 2023
1. Write python program to display output like.
2
468
10 12 14 16 18
2. Write python program using module, show how to write and use
module by importing it.
3. WAP to read contents of first.txt file and write same content in
second.txt file.
4. Write a program illustrating use of user defined package in python.
5. Write a program illustrating use of user defined package in python.
6. Write program to implement concept of inheritance in python.

Winter 2022
1. Write any 4 methods of dictionary
2. Write python program to illustrate if else ladder
3. Write python code for finding greatest among four numbers.
4. Illustrate with example method overloading.
5. Write python code to read contents of abc.txt and write same content
to pqr.txt.
6. Write python program to perform following operations on set.
v) Create set
vi) Access set elements
vii) Update set
viii) Delete set.
7. Design a class student with data members; Name, roll number address.
Create suitable method for reading and printing students details.
8. Create a parent class named Animals and a child class Herbivorous
which will extend the class Animal. In the child class Herbivorous over
side the method feed (). Create a object of the class Herbivorous and
call the method feed.

Common Questions:

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


2. Write a python program that takes a number and checks whether it is a
palindrome.
3. Write a Python program to calculate sum of digit of given number using
function.
4. Write a python program takes in a number and find the sum of digits in
a number.
5. Design a class student with data members : name, roll no.,
department, mobile no. Create suitable methods for reading and
printing student information.
6. Design a class student with data members; Name, Roll No., Address.
Create suitable method for reading and printing students details.
7. Design a class student with data members; Name, roll number address.
Create suitable method for reading and printing students details.
8. Write a python program to create class student with roll-no and display
its contents.
9. Write python program to perform following operations on set.
Create set
Access set elements
Update set
Delete set.
10. Explain basic operation performed on set with suitable example.
11. Write python program to perform following operations on set.
Create set of five elements
Access set elements
Update set by adding one element
Remove one element from set.
12. With suitable example explain inheritance in Python.
13. Write a program to implement the concept of inheritance in python.
14. Write program to implement concept of inheritance in python.
15. Write a program illustrating use of user defined package in python.
16. Write a program illustrating use of user defined package in Python.
17. Explain method overloading in python with example.
18. Illustrate with example method overloading.
19. WAP to read contents of first.txt file and write same content in
second.txt file.
20. Write a Python program to read contents from “a.txt” and write
same contents in “b.txt”
21. Write python code to read contents of abc.txt and write same
content to pqr.txt.

⚠️Disclaimer, Some codes can be missed.


This list of common questions does not include:
 Questions that ask to "Write the output of the following" code.
 Questions that require answers with examples.
Also some codes can be missed

© 2025 Naitik Donda. All Rights Reserved.

This document is created by Naitik Donda. It may not be copied,


distributed, or shared without giving proper credit. Please provide five
credits before sharing or using any part of this document. Unauthorized
use is prohibited.

For any queries; gmail> dondanaitik@gmail.com

You might also like