0% found this document useful (0 votes)
4 views14 pages

Python QB

The document outlines a question bank for a Python programming course, detailing course information, cognitive levels, and specific learning outcomes. It includes structured questions across different units, categorized into parts A, B, and C, focusing on various aspects of Python programming such as control structures, functions, and string manipulation. Each question is assigned a Bloom's level and course outcome, emphasizing the cognitive skills required for students to demonstrate their understanding of the material.

Uploaded by

d256kndyr2
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)
4 views14 pages

Python QB

The document outlines a question bank for a Python programming course, detailing course information, cognitive levels, and specific learning outcomes. It includes structured questions across different units, categorized into parts A, B, and C, focusing on various aspects of Python programming such as control structures, functions, and string manipulation. Each question is assigned a Bloom's level and course outcome, emphasizing the cognitive skills required for students to demonstrate their understanding of the material.

Uploaded by

d256kndyr2
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

QUESTION BANK

Details of the Course


Name of the Department : Computer Science and Engineering
Name of the Course : Programming in Python
Course Code : 23ES1206
Regulation : 2023
Semester : II
Common To Programme(s) : All Branches
Instructions
● Questions must be clear, unambiguous, and error-free.

● Avoid repetitive or overlapping questions.

● Use appropriate diagrams/tables wherever required.

● Numerical problems must include complete data.

● Avoid outdated or syllabus-irrelevant topics.


Blooms Level: Blooms Level 1 & 2 is Lower Order (LO) Cognitive type, Blooms Level 3 & 4 is Intermediate Order
Cognitive Type (IO) and Blooms Level 5 & 6 is Higher Order (HO) cognitive type.
Course Outcome: (List the Course Outcomes of the Course)
CO1: Illustrate conditionals and loops for solving problems using Python programs.
CO2: Express proficiency in the handling of strings and functions.
CO3: Apply Python lists, tuples, dictionaries, sets etc to represent compound data.
CO4: Compare and contrast reading and writing data from/to files and handle exceptions in Python programs.
CO5: Experiment with python packages in data analysis and design GUI
CO6: Build real time applications using problem solving concepts in python.
Bloom’s Level: BL1 - Remembering, BL2 - Understanding, BL3 - Applying, BL4 - Analyzing, BL5 – Evaluating, BL6 - Creating.

UNIT- I - INTRODUCTION TO PYTHON PROGRAMMING AND CONTROL STRUCTURES


Questions should be of:
i. Basic concepts, definitions, laws, and simple applications.
ii. Lower order (LO) cognitive and may be of Intermediate order (IO) cognitive type.
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted

1. Why are keywords not allowed to be used as variable names in [BL2] [CO1] [2]
Python?
2. List any two built-in typecasting functions in Python. [BL1] [CO1] [2]
3. Define an identifier. [BL1] [CO1] [2]
4. How does a while loop differ from a for loop in Python. [BL2] [CO1] [2]
5. State the differences between break, continue and pass statements. [BL2] [CO1] [2]
6. What is the purpose of indentation in Python? [BL1] [CO1] [2]
7. How would you find the factorial of a number using a for loop in [BL2] [CO1] [2]

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
Python.
8. Name two distinct Python modes and discuss their benefits and [BL1] [CO1] [2]
drawbacks.
9. Enumerate the keywords available in Python and mention their [BL2] [CO1] [2]
purpose.
10. Compare the precedence of logical AND and OR operators. [BL2] [CO1] [2]

PART B ( 13 Marks)
[Link] should be of Concept explanation, detailed reasoning, numerical problems, and derivations.
[Link] should be of Understanding / Applying/ Analyzing/ Evaluating
[Link] number of Subdivisions is Three.

1. i. Analyze the concept of operator precedence and associativity in [BL4] [CO1] [13]
Python
ii. Compare the evaluation of arithmetic, logical, and relational
expressions using code examples to illustrate left-to-right and
right-to-left associativity.
2. i. Develop a Python program to compute the sum of digits of a given [BL5] [CO1] [6+7
integer using appropriate control structures. ]
ii. Design a Python program that allows the user to guess a randomly
generated integer within a specified range and provides suitable hints
until the correct number is guessed.
3. Design a Python program to simulate a simple ATM system with the [BL6] [CO1] [13]
following features:
i. User authentication using PIN (3 attempts only).
ii. Balance enquiry and Cash withdrawal with minimum balance
constraint.
iii. Deposit amount.
4. Develop a menu-driven Python program using functions to perform the [BL6] [CO1] 13
following operations on a number:
i. Check whether the number is prime
ii. Generate Fibonacci series up to n terms
iii. Check whether the number is Armstrong or not.
5. Apply Python data types to write examples showing numeric, [BL3] [CO1] [13]
sequence, and mapping data types.
6. Develop a Python program that accepts values from the user and [BL6] [CO1] [13]
illustrates both implicit type conversion (automatic) and explicit type
conversion (using casting functions like int(), float(), str()).
7. Write a Python program to print the following pattern using nested [BL4] [CO1] [13]
loops:
1
12
123
1234
12345
8. i. Design Python programs using a for loop to demonstrate early loop [BL6] [CO1] [13]
termination and iteration skipping mechanisms.
ii. Write a Python program to identify and count all vowel characters in
a string provided by the user.
9. Classify and explain the different lexical components used in Python [BL4] [CO1] [13]
programming language and illustrate how each component contributes

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
to program formation.
10. Write a Python program to implement a find the number game where [BL2] [CO1] [13]
the user guesses a randomly generated number within a given range.
Use suitable control structures.
Part C (15 Marks) (Only of Higher Order Thinking Question)
i. Questions should be of Higher Order (HO) cognitive type.
ii. Formulate questions that align with the Evaluate and Create levels of higher-order thinking.
iii. Maximum number of Subdivisions is Three.
1. Demonstrate, with the help of Python code snippets, the execution of [BL5] [CO1] [15]
programs in interactive mode and script mode.
2. Simulate a switch statement in Python using a menu-driven program [BL4] [CO1] [15]
that lets the user calculate the factorial of a number using either
recursion or iteration.
3. Write a Python script that: [BL5] [CO1] [15]
i. Uses break, continue, and pass meaningfully in different
segments. Include an expression evaluator that:
ii. Takes an arithmetic expression as input. Demonstrates how
Python resolves operator precedence and associativity

4. Create a Python program that solves the Towers of Hanoi problem and [BL6] [CO1] [15]
integrates control structures effectively.
Your solution should:
i. Use a recursive function to print the steps for moving n disks.
ii. Evaluate the effect of recursion depth and control structure
selection on performance and readability.
iii. Provide a written justification comparing recursion vs. iteration
in solving algorithmic problems.
5. import random [BL5] [CO1] [15]
num = [Link](1,10)
guess = 0

while guess != num:


guess = int(input("Guess a number: "))
if guess > num:
print("Low")
elif guess < num:
print("High")
else:
print("Correct")
print("Game Over")

Evaluate the program and perform the following:


i. Identify and explain all logic mistakes, especially in the
comparison messages ("High" / "Low").
ii. Illustrate how loop-else, break, and continue could improve the
logic or user experience.
iii. Rewrite a corrected and enhanced version of the game using
Proper indentation, Clear variable naming,A maximum number

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
of attempts

UNIT- II - FUNCTIONS AND STRINGS


Questions should be of:
[Link] concepts, definitions, laws, and simple applications.
[Link] order (LO) cognitive and may be of Intermediate order (IO) cognitive type.
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted

1. How do functions contribute to modular programming in Python? [BL1] [CO1] [2]


Mention any two advantages.
2. Differentiate between a parameter and an argument with a simple [BL2] [CO1] [2]
example
3. State the difference between user-defined and built-in function. [BL2] [CO1] [2]
4. What are default arguments? How do they help in reducing function [BL2] [CO1] [2]
calls complexity?
5. Explain how default arguments and variable scope (local and global) [BL2] [CO1] [2]
enhance the flexibility of user-defined functions in Python.
6. Distinguish between user-defined functions and built-in functions with [BL2] [CO1] [2]
appropriate examples
7. Justify when a lambda function preferred over normal functions. [BL2] [CO1] [2]
8. How do default arguments affect function calls in Python? [BL2] [CO1] [2]
9. Identify the error (if any) in a function that modifies a global variable [BL2] [CO1] [2]
without using the global keyword
10. Predict the output of a Python function that uses recursion to reverse a [BL2] [CO1] [2]
string.
PART B ( 13 Marks)
[Link] should be of Concept explanation, detailed reasoning, numerical problems, and derivations.
[Link] should be of Understanding / Applying/ Analyzing/ Evaluating
[Link] number of Subdivisions is Three.
1. Consider the following Python code snippet: [BL3] [CO2] [13]
1 def check_string(s):
mid = len(s) // 2
if s[:mid] == s[mid:]:
print("Symmetrical")
if s == s[::-1]:
print("Palindrome")
i. Identify the error in checking symmetry for odd-length strings.
ii. Modify the above code snippet to correctly check both even
and odd length strings.
iii. Write the complete Python program including input and output
statements..
2. Develop a Python program that processes a string by toggling the case [BL3] [CO2] [13]
2 of each character. Illustrate how built-in string methods support this
transformation.

3. i .Write a Python program to reverse a string using an iterative [BL4] [CO2] [13]
approach. Analyze the difference between iterative and recursive
approaches.
ii. With a suitable example, analyze the behavior of local and global
variables during function execution.

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
4. Consider the Python code snippet given below: [BL3] [CO2] [13]
x = 10
def display():
x = 5
print(x)

display()
print(x)
i. Write the output of the above code snippet.
ii. Modify the code to change the value of the global variable inside the
function.
iii. Explain the behavior of local and global variables through the
modified program.
5. Develop a menu-driven Python program using user-defined functions [BL4] [CO2] [13]
to perform sorting operations. Evaluate how the use of functions
improves program modularity and readability.
6. i. Explain the concept of lambda functions and implement a Python [BL3] [CO2] [8+5
program to generate the Fibonacci series using lambda expressions. ]
ii. Develop a Python program to compute the power of a number using
functions.
7. Using the below code snippets, explain how Python supports string [BL6] [CO2] [13]
manipulation through formatting, comparison, slicing, and negative
indexing.
Also, examine the role of Python built-in functions in simplifying
program development, illustrating how they improve code readability
and efficiency with suitable explanations
name = "Python"
version = 3.12
print("Language: {}, Version: {}".format(name, version))
s1 = "apple"
s2 = "banana"
print(s1 < s2)
text = "Programming"
print(text[0:6])
print(text[-3:])
numbers = [4, 1, 8, 3]
print(len(numbers))
print(max(numbers))
print(sorted(numbers))
value = -10
print(abs(value))
8. i. Identify the purpose of each built-in function used in the code. [BL3] [CO2] [13]
[Link] a Python program using at least four built-in functions to
perform basic operations on a list of integers.
iii. Explain how the use of built-in functions simplifies program
development compared to user-defined logic.
numbers = [12, 4, 9, 2, 15]
print(len(numbers))
print(max(numbers))
print(min(numbers))
print(sorted(numbers))

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
value = -25
print(abs(value))
9. i. Develop a recursive Python program to compute the sum of the first [BL3] [CO2] [6+7
n natural numbers. ]
ii. Using recursion, design a Python program to calculate the factorial
of a given number.
10. A company has employee records stored as text. Each record contains [BL4] [CO2] [13]
email addresses and phone numbers. HR wants to validate emails and
mask phone numbers using Python regular expressions.
i. Examine the code snippet:
import re
email = "[Link]@[Link]"
pattern = r'^[a-zA-Z0-9._]+@[a-zA-Z]+\.[a-zA-Z]{2,3}$'
if [Link](pattern, email):
print("Valid email")

else:
print("Invalid email")
Explain how the regex works and Modify it to also accept .org and .net
emails.
ii. Explain how the masking works and modify the code to mask only
the last 4 digits..
Part C (15 Marks) (Only of Higher Order Thinking Question)
i. Questions should be of Higher Order (HO) cognitive type.
[Link] questions that align with the Evaluate and Create levels of higher-order thinking.
[Link] number of Subdivisions is Three.
1. Discuss about selection sorting with necessary example and write [BL5] [CO2] [15]
about regular expression.
2. Discuss about various string built in methods with example. [BL5] [CO2] [15]
3. Design and implement a Python program using suitable functions (with [BL5] [CO2] [15]
default parameters, keyword arguments, and arbitrary arguments) to
evaluate the following tasks in a single menu-driven application:
[Link] the power of a number using recursion.
[Link] a list of numbers using a lambda-based custom key.
[Link] n terms of the Fibonacci series using lambda +
reduce/map.
4. Create a Python application to process and analyze strings using built- [BL6] [CO2] [15]
in functions and regular expressions.
program includes:
i. Accept a string from the user and perform Advanced slicing
(including negative indices) ,String comparison between two
inputs
ii. Use regular expressions to Match a given pattern (e.g., email,
date, or mobile number) and Search and replace specific
substrings
5. Illustrate a written explanation evaluating your design decisions: [BL6] [CO2] [15]
i. Why recursion is suitable or unsuitable for vowel counting.
ii. How lambda expressions improve or simplify your logic.

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
iii. Why regex may be preferred over traditional string methods for
pattern detection.

UNIT- III- COLLECTIONS


Questions should be of:
[Link] concepts, definitions, laws, and simple applications.
[Link] order (LO) cognitive and may be of Intermediate order (IO) cognitive type.
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted

1. In Python, how the values stored in a list are accessed? Should the [BL2] [CO3] [2]
elements of a list be of the same data type?
2. A programmer replaces the following loop: [BL2] [CO3] [2]
squares = []
for i in range(1, 6):
[Link](i*i)
with:
squares = [i*i for i in range(1, 6)]
Explain how list comprehension changes the conceptual model of list
creation.
3. How do membership operators influence decision-making in programs, [BL2] [CO3] [2]
and what role do they play when working with collections?
4. Write a program to create a clone of then list: [BL2] [CO3] [2]
list 1= [ 1,2,3,4,5,6]
5. How Python’s dictionary store data? Give example [BL2] [CO3] [2]
6. How do tuple operations allow data access and manipulation while still [BL2] [CO3] [2]
preserving immutability, and where is this behavior practically useful?
7. Give a function that can take a value and return the first key mapping [BL2] [CO3] [2]
to that value in a dictionary.
8. Why is conversion between mutable and immutable sequence types [BL2] [CO3] [2]
sometimes necessary, and how does such conversion affect data
handling?
9. How can identifying extreme values within a tuple support data [BL2] [CO3] [2]
analysis tasks, and what logical steps are involved in such a process?
10. How do packing and unpacking mechanisms improve flexibility in [BL2] [CO3] [2]
tuple usage, particularly when handling multiple return values or
assignments?
PART B ( 13 Marks)
[Link] should be of Concept explanation, detailed reasoning, numerical problems, and derivations.
[Link] should be of Understanding / Applying/ Analyzing/ Evaluating
[Link] number of Subdivisions is Three.
1. i. Describe the addition and deletion operation in a list data [BL5] [CO3] [13]
structure with examples.
ii. Write a program that has a nested list to store topper details and
display the details.
2. Write a program to generate the electricity bill based upon the number [BL4] [CO3] [13]
of units consumed. Refer the table below for unit and price details.
No. of Units Consumed Price Price
(Domestic) (Commercial)
Up to 200 units 200 (Base 500
price)

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
Units > 200 and < 500 1100 1700
Units > 500 and < 1000 4500 7000
Note:
The program should read information from the user and determine
whether the connection is for domestic or commercial purpose. Use the
following concepts
 Dictionary → tariff mapping
Tuple → slab representation
3. Outline the algorithm and write a Python program to sort the numbers [BL5] [CO3] [13]
in ascending order using merge sort.
4. Explain sets in Python. Discuss their features and various set [BL3] [CO3] [13]
operations with suitable examples
5. State Dictionary in Python. Do the following operations on [BL3] [CO3] [13]
dictionaries.
i. Initialize two dictionaries with key and value pairs and
Compare the two dictionaries with master key list and print
missing keys.
ii. Find keys that are in first and not in second dictionary and Find
same keys in two dictionaries.
iii. Merge two dictionaries and create a new dictionary using a
single expression.
6. Discuss the following [BL3] [CO3] [13]
i. Tuples as return values
ii. Variable Length Argument Tuples
iii Write a program to illustrate the comparison operators in
tuple
7. Explain about linear search and write a python program to perform [BL3] [CO3] [13]
linear search on a list.
8. [Link] a python program to create a histogram from a given list of [BL4] [CO3] [6+7]
integers.
[Link] a python program for transpose of a given matrix.
9. [Link] a program to interchange the first and last element in a list. [BL3] [CO3] [6+7]
[Link] a python program to sort a dictionary by key or value.
10. i. How can you determine the size of a set in Python? ii. Discuss about [BL6] [CO3] [6+7]
calendar program supported by python.
Part C (15 Marks) (Only of Higher Order Thinking Question)
[Link] should be of Higher Order (HO) cognitive type.
[Link] questions that align with the Evaluate and Create levels of higher-order thinking.
[Link] number of Subdivisions is Three.
1. Demonstrate python nested list and give the example programs for [BL5] [CO3] [15]
matrix addition, subtraction and multiplication.
2. a. How can lists, tuples, and dictionaries handle mixed data types? [BL6] [CO3] [15]
Provide examples for each.
b. Discuss about tuple assignment and write a python program for
swapping of two numbers using tuple assignment.
3. A software development team is building a data preprocessing module [BL6] [CO3] [15]

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
in Python that must handle heterogeneous data efficiently and
readably.
i. Create a single list containing mixed data types relevant to the
application domain.
Using this list: Demonstrate element access using both positive and
negative indices and Perform slicing to extract meaningful subsets,
Explain how Python’s list indexing model supports these operations.
ii. Apply at least five different list methods within the same program.

4. t = (10, 5, 25, 40, 2, 15) [BL5] [CO3] [15]


max_n = sorted(t)[-3:]
min_n = sorted(t)[:3]
t[0] = 100
i. Identify and explain all errors in the code related to tuple
immutability.
ii. Redesign the program to extract the maximum and minimum N
elements from a tuple without converting the tuple into a list.
iii. Create a new tuple combining two tuples and perform on
Slicing, Indexing and Tuple operations (concatenation,
repetition)
5. A university plans to develop a student performance analysis system [BL6] [CO3] [15]
using Python collections to efficiently manage and evaluate academic
data.
Create a dictionary where student names act as keys and their marks as
[Link], using appropriate Python code, how the system
can:
i. Add new student records
ii. Modify marks of existing students
iii. Delete specific student entries

UNIT- IV- FILES AND EXCEPTION HANDLING


Questions should be of:
[Link] concepts, definitions, laws, and simple applications.
[Link] order (LO) cognitive and may be of Intermediate order (IO) cognitive type.
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted

1. What is meant by a file, and what benefits does it offer in terms of data [BL1] [CO4] [2]
storage and management?
2. How can files be classified as text files and binary files, and in what [BL2] [CO4] [2]
ways do they differ from each other?
3. Write the difference between ftell () and fseek(). [BL2] [CO4] [2]
4 Describe the role and applications of command line arguments in [BL1] [CO4] [2]
Python programs.
5 How can files be opened in Python using different access modes? [BL1] [CO4] [2]
6 List and explain some commonly used built-in exceptions in Python [BL2] [CO4] [2]
with suitable examples.
7 Explain the differences between append mode and write mode in file [BL2] [CO4] [2]

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
handling.
8 What is exception chaining in python? provide an example. [BL2] [CO4] [2]
9 How can a user-defined exception be defined in Python? Write a basic [BL2] [CO4] [2]
example.
10 Why are clean-up actions important in exception handling, and how are [BL2] [CO4] [2]
they implemented.
PART B ( 13 Marks)
[Link] should be of Concept explanation, detailed reasoning, numerical problems, and derivations.
[Link] should be of Understanding / Applying/ Analyzing/ Evaluating
[Link] number of Subdivisions is Three.
1. Write a python function to copy the contents of one file to another by [BL3] [CO4] [13]
reading and writing up to 50 characters at a time.
2. Explain the ftell() and fseek() methods in file handling? with suitable [BL3] [CO4] [13]
examples.
3. Write a Python program to count the number of words in a given [BL3] [CO4] [13]
sentence using the split() method, and list other methods that can be
used to count words.
4. i. Write a Python program to copy the contents of one file to another [BL3] [CO4] [13]
file and display the copied contents.
ii. Write a Python program to handle a division-by-zero exception
using appropriate exception handling constructs.
5. i. Explain command-line arguments in Python with an example [BL5] [CO4] [13]
program.
ii. Describe the use of the pickle module in Python with an example of
dumping data into a file.
6. Differentiate between syntax errors and exceptions in Python by [BL4] [CO4] [13]
analyzing sample programs that demonstrate each.
7. Demonstrate exception handling in Python by using a try–except [BL3] [CO4] [13]
block, and explain its working with a suitable example.
8. Differentiate the use of raising exceptions in Python and show their [BL4] [CO4] [13]
behavior with an example program.
9. Illustrate the various file operations are performed by using suitable [BL3] [CO4] [13]
examples.
10. Construct and generalize a case study for the preparation and analysis [BL6] [CO4] [13]
of students’ mark statements by applying exception handling.
Part C (15 Marks) (Only of Higher Order Thinking Question)
[Link] should be of Higher Order (HO) cognitive type.
[Link] questions that align with the Evaluate and Create levels of higher-order thinking.
[Link] number of Subdivisions is Three.
1. Develop Python programs showcasing the application of try, except, [BL6] [CO4] [15]
and finally blocks for robust error handling.
2. Examine and assess Python code that prompts the user to enter an [BL5] [CO4] [15]
integer, raising a ValueError if the input is invalid.
3. Design a Python program that reads a file and incorporates exception [BL6] [CO4] [15]
handling to manage a FileNotFoundError if the file does not exist.

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
4. Create a complete file-processing application that demonstrates the use [BL6] [CO4] [15]
of:
i. Opening files in different modes (read, write, append, file copy)
ii. Using tell() and seek() to navigate the file
iii. Reading content line-by-line, word-by-word, and character-by-
character and find the word count without using built-in
functions

5. src = "[Link]" [BL5] [CO4] [15]


dest = "[Link]"
f1 = open(src)
f2 = open(dest, "w")
for line in f1:
[Link](line)
print([Link]())
[Link](5)
[Link]
[Link]

Evaluate the code and answer the following:


i. Identify and explain all errors, including issues with:
Missing file modes
Incorrect file closure
Misuse of tell() and seek()
ii. Rewrite a corrected version of the program with proper:
Exception handling
Resource management using with block
Cursor positioning

UNIT- V PACKAGES & GUI


Questions should be of:
[Link] concepts, definitions, laws, and simple applications.
[Link] order (LO) cognitive and may be of Intermediate order (IO) cognitive type.
Course Marks
PART A ( 2 Marks) Bloom’s Level
Outcome Allotted

1. Why are Python packages like NumPy and Pandas preferred over [BL2] [CO5] [2]
normal Python lists for handling large datasets?
2. How does a Pandas Series differ from a normal Python list in terms of [BL2] [CO5] [2]
functionality?
3. What is the role of NumPy when creating a Pandas Series? [BL1] [CO5] [2]
4. How does a Pandas DataFrame represent data more effectively than a [BL2] [CO5] [2]
2D list?
5. Why is Matplotlib commonly used along with Pandas in data analysis [BL2] [CO5] [2]
applications?
6. How do Tkinter widgets help in building interactive user interfaces? [BL2] [CO5] [2]
7. What advantages does Tkinter offer for developing GUI-based Python [BL2] [CO5] [2]
applications?

8. Why is an IDE preferred over command-line execution when [BL2] [CO5] [2]

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
developing GUI applications in Python?
9. Explain the role of the Axes object in Matplotlib and how it differs [BL2] [CO5] [2]
from the Figure object.
10. How does effective layout management influence usability and [BL2] [CO5] [2]
responsiveness in a GUI-based application when using packages to
create a marksheet or calendar?
PART B ( 13 Marks)
[Link] should be of Concept explanation, detailed reasoning, numerical problems, and derivations.
[Link] should be of Understanding / Applying/ Analyzing/ Evaluating
[Link] number of Subdivisions is Three.
1. import numpy as np [BL4] [CO5] [13]
import pandas as pd
import [Link] as plot
nums = [Link]([1,2,3,4])
s = [Link](nums)
[Link](nums)
[Link]()
Evaluate the code and answer the following:
i. Identify all errors in NumPy, Pandas, Matplotlib usage and Rewrite
corrected program with a line graph.
ii. Explain how Pandas integrates with Matplotlib.
[Link] how visualization improves understanding of datasets.
2. Write a Python program to create a Pandas DataFrame using a two- [BL3] [CO5] [13]
dimensional list and perform simple data manipulation operations..
3. Write a python program to create a Pandas DataFrame using a 2D list [BL3] [CO5] [13]
and perform basic data manipulations.
4. Analyze and compare Bar Charts and Histograms in Matplotlib for [BL4] [CO5] [13]
visual analytics. Evaluate the impact of parameters such as bins, labels,
alignment, and scaling on data interpretation. Illustrate with Python
programs for a bar chart and a histogram.
5. Explain Tkinter and write a Python program to create a GUI-based [BL3] [CO5] [13]
Student Marksheet application.
6. import numpy as np [BL4] [CO6] [13]
a = [Link](10,20,30)
b = [Link]([1,2,3])
c = a+b
print(c)
Evaluate the code and answer the following:
i. Identify the array creation error and Rewrite the corrected code.
ii. Explain broadcasting in NumPy.
iii. Discuss benefits of NumPy over Python lists.
7. Explain the importance of Pandas and NumPy in handling structured [BL4] [CO6] [13]
data.
8. Analyze the importance of layout managers in Tkinter and their impact [BL4] [CO5] [13]
on usability and responsiveness of GUI applications.

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
9. from tkinter import * [BL4] [CO5] [13]
from tkinter import file
def open():
f = [Link]()
lbl = Label(text=f)
[Link]()
root = Tk()
btn = Button(text=&quot;Open File&quot;, command=open)
[Link]()
[Link]()
Evaluate the code and answer the following:
i. Identify and explain errors (wrong module, wrong function
names) and Rewrite corrected version.
ii. Explain how filedialog works.
iii. Discuss real-world uses of file explorers.
10. print"Welcome to IDE" [BL4] [CO5] [13]
x = input("Enter value:")
print("You entered: " + x)

[Link] the code and answer the following:


Identify syntax errors (print, input).
Fix the program.
Explain advantages of using IDEs for GUI programming.(7)
[Link] how IDE debugging tools help identify runtime errors.(8)

Part C (15 Marks) (Only of Higher Order Thinking Question)


[Link] should be of Higher Order (HO) cognitive type.
[Link] questions that align with the Evaluate and Create levels of higher-order thinking.
[Link] number of Subdivisions is Three.
1. Describe the role of different Tkinter widgets in user interface design [BL5] [CO5] [15]
and demonstrate their usage through a Python program?
2. Demonstrate how NumPy can be integrated with Pandas to create a [BL3] [CO5] [15]
Series and perform basic data manipulation operations?
3. Create an end-to-end data analysis mini-application using NumPy, [BL6] [CO5] [15]
Pandas, and Matplotlib.
Generate a NumPy array of student marks and convert it into a Pandas
Series.
i. Construct a Pandas DataFrame from a 2D list containing
student details (Name, Roll No, Marks).
ii. Perform the following operations on the DataFrame:
o Add a new column for Grade
o Replace missing values
o Filter rows based on conditions
iii. Use Matplotlib to plot:
o A bar chart of marks
o A line chart showing marks progression

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation
Justify how your visualization supports data interpretation better than
textual output.
4. import pandas as pd [BL5] [CO5] [15]
import numpy as np
arr = [Link](5)
s = [Link](arr)
data = [[1,2,3], [4,5]]
df = [Link](data, col=["A","B","C"])
print(df)
Evaluate the code and do the following:
i. Identify and explain all errors regarding:
o NumPy function usage
o Pandas Series creation
o DataFrame construction
o Column mismatch and syntax issues
ii. Rewrite the corrected program and justify each correction.
iii. Evaluate the advantages of using Pandas DataFrame over
Python lists for structured data.
5. Analyze the role of Matplotlib’s inbuilt plotting methods in visual [BL5] [CO5] [15]
analytics and evaluate how visualization parameters affect
interpretability. Illustrate your answer with a Python program to
generate a customized pie chart with justification.

Couse Instructor Course Coordinator Head of the Department


Name & Designation Name & Designation

You might also like