python_coding_questions
python_coding_questions
1010101
10101
101
1
2. Write a Python program to perform the following operations on a set:
- Create a set of five elements
- Access set elements
- Update set by adding one element
- Remove one element from the set
3. Write a Python program that checks whether a given number is a palindrome.
4. Write a Python program to create a user-defined module that asks for your program
name and displays it.
5. Write a Python program to find the sum of digits in a number.
6. Write a program function that accepts a string and calculates the number of uppercase
and lowercase letters.
7. Write a Python program to create a class 'Student' with roll number and display its
contents.
8. Write a Python program to generate five random integers between 10 and 50 using
NumPy.
9. Write a Python program to create a class 'Diploma' with subclasses 'CO' and 'IF', each
having a method that prints respective diploma types.
10. Write a Python program to implement multiple inheritance.
11. Write a Python program to create a user-defined exception for password checking.
2
468
10 12 14 16 18
13. Write a Python program using a module, showing how to write and import it.
14. Write a Python program to read the contents of 'first.txt' and write them to 'second.txt'.
15. Write a Python program illustrating the use of a user-defined package.
16. Write a Python program to create a class 'Student' with Roll No. and Name and display
its contents.
17. Write a Python program to implement the concept of inheritance.
2023 Summer Question Paper
18. Write a Python program to find the factorial of a number.
19. Write a Python program to input two tuples and interchange their values.
20. Write a program to show a user-defined exception in Python.
21. Write a Python program to check if a string is a palindrome.
22. Write a Python program to calculate the sum of digits in a number using a function.
23. Write a Python program to accept values from the user in a list and find the largest and
smallest numbers.
24. Design a class 'Student' with data members: name, roll number, department, and mobile
number. Create methods for reading and printing student information.
1
12
123
1234
26. Write a program to create a class 'Employee' with ID and Name and display its contents.
27. Write a program to import a module for the addition and subtraction of two numbers.
28. Write a program to create a dictionary of students that includes their Roll No. and
Name:
- Add three students
- Update name = 'Shreyas' for Roll No. = 2
- Delete information for Roll No. = 1
29. Write a program illustrating the use of a user-defined package in Python.
30. Write a program to open a file in write mode and append content at the end.
31. Write a program to implement the concept of inheritance in Python.