Python_Exam_Preparation
Python_Exam_Preparation
Tech CSE
- Function definition
- Loop (for/while)
- if-elif-else
16. What is the difference between shallow copy and deep copy?
17. Compare mutable and immutable data types in Python with examples.
1. Write a Python program to take two numbers as input and print their sum, difference, product, and division.
10. Take a list of numbers and remove all duplicates using a set.
11. Write a program to write your name and age into a file.
OOP Questions
Python Exam Preparation Notes - B.Tech CSE
14. Create a class Student with attributes name, age, and grade. Add a method to display student details.
15. Create two classes Person and Employee where Employee inherits from Person. Show constructor
overriding.
18. Create a dictionary to store 3 students' names and their marks. Print all keys and values.
19. Write a Python program to sort a list of tuples by the second element.