PCA25C04J · Model Exam
Covers all units: Introduction / Object Oriented Programming / Modules & Threads / Data Analysis / GUI and SQL lite
Answer ANY FIVE Questions
Differentiate between Interactive Mode and Script Mode in the Python Interpreter with examples.
Write a Python program using an if-else statement to check whether a given number is even or odd. Explain the working of the program.
Write a Python program to create a class Dog with a class attribute sound = "bark". Create an object of the class and display the sound of the dog.
Describe user-defined exceptions in Python. Give the steps to create and handle a custom exception.
List the steps involved in creating a user-defined module in Python.
How can race conditions occur in multithreading, and how can they be prevented using Lock() in Python?
Discuss the basic array operations in Python using NumPy. How do you create an array, access elements, and perform indexing and slicing?
Describe the steps involved in establishing database using the sqlite3 module.
Answer ALL Questions
Explain String, List and Tuple with their applications in data analysis using Python with example programs.
Describe various looping statements with suitable syntax and programs. Also explain the use of break, continue, and pass statements in Python.
Discuss the purpose and advantages of inheritance in object-oriented programming. Illustrate the use of the super() function and explain the different types of inheritance Single, Multiple, Multilevel in Python with suitable examples.
Write a Python program to:
(i) Define a custom exception class named InvalidAgeError. (5)
(ii) Raise this exception when the age entered is not within the valid range (0-120). (5)
(iii) Handle the exception using a try-except block and display a meaningful error message. (5)
Illustrate the use of threads with suitable examples, including thread communication and the join() method. Also discuss the advantages, limitations, and applications of multithreading.
Describe various parallel system tools such as multiprocessing, concurrent.futures, joblib, and Dask. Write suitable Python programs to demonstrate at least two parallel processing techniques and compare their performance with sequential execution.
Perform a complete analysis of student marks using NumPy arrays in Python. Creating arrays, performing arithmetic & statistical operations and provide interpretations.
Create a Pandas DataFrame for five students containing their subject marks and then visualize the data by drawing a line plot to show each student's marks in all subjects, a bar chart to compare marks across students, and a histogram to display the distribution of Maths marks.
Design and explain a Tkinter-based interactive program that uses dialog boxes, message boxes, and entry widgets for user input and communication in a data analysis application.
Explain the concept of keys in SQLite and discuss different types of keys such as Primary Key, Foreign Key, Composite Key and unique constraint with suitable examples and Python programs. Also explain their importance in data analysis.