AKTU Python Programming (BCC302) Question Paper 2024-25
| University | Dr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow |
|---|---|
| Course | B.Tech, Semester III |
| Subject | Python Programming (BCC302) |
| Exam | Theory Examination 2024-25 (odd semester) |
| Time · Marks | 3 hours · 70 marks |
| Source | AKTU question paper, from the ABESIT question paper bank |
Note: Attempt all Sections. In case of any missing data; choose suitably.
Section A
Q1. Attempt all questions in brief · 2 × 7 = 14 marks
- State how to handle exceptions in Python? Provide a simple example.
- What will be the output of the following Python code?
def compute(x):return [i**2 for i in x if i%2==0]print(compute([1, 2, 3, 4, 5])) - Explain floor division with an example
- Describe the purpose of the ‘with’ statement in file handling?
- Briefly describe the use of lambda functions in Python.
- Demonstrate how to assign a single value to a tuple.
- Explain why numpy is used instead of python arrays for mathematical calculations?
Section B
Q2. Attempt any three of the following · 7 × 3 = 21 marks
- Design a basic calculator in Python that supports addition, subtraction, multiplication, division.
- Define Membership and Identity Operators.
Given:a = 3b = 3Distinguish between: (a is b) and (a = = b) ? - Write a Python function to count the frequency of each character in a given string and return the output in a dictionary. Example:
char_frequency("HELLO") returns {"H":1, "E":1, "L":2, "O":1}"O":1} - Write a program to reverse the contents of a file character by character, separating each character with a comma.
- Create a pie chart using matplotlib to represent the following data:
Languages PopularityPython 30Java 25C++ 20JavaScript 15Ruby 10
Section C
Q3
Attempt any one part of the following · 7 × 1 = 7 marks
- Write short notes on the following with examples: a) Operator Precedence b) Python Indentation c) Type Conversion
- Write a program to validate email addresses using regular expressions.
Criteria:
1. Must contain @ symbol2. Must contain domain name3. Should not have spaces
Q4
Attempt any one part of the following · 7 × 1 = 7 marks
- Write a program to create a hollow pyramid pattern given below:
** ** ** ********** - Explain the why loops are needed and the types of loops in python. Discuss break and continue with example.
Q5
Attempt any one part of the following · 7 × 1 = 7 marks
- Write a function to find the longest word in a given list of words. Example: longest_word([‘apple’, ‘banana’, ‘cherry’]) returns ‘banana’. : longest_word(['apple', 'banana', 'cherry'])
- Distinguish between a Tuple and a List with examples. Explain with examples atleast 4 built-in methods of Dictionary.
Q6
Attempt any one part of the following · 7 × 1 = 7 marks
- Discuss different types of file modes in Python? Explain with examples.
- Write a program to read a CSV file and display the rows where a specific column value exceeds a given threshold.
Q7
Attempt any one part of the following · 7 × 1 = 7 marks
- Discuss the role of event handling in Tkinter. How can you bind events to widgets? Provide examples.
- Write a program to read data from a CSV file 'students.csv', calculate the average marks for each student, and display the results.
Short on time? See the most repeated AKTU Python Programming questions across all years.
Other years
More AKTU Python Programming papers on LearnAIFast.
This paper is reproduced for study purposes only. Copyright belongs to AKTU. Source: the question paper bank of ABES Institute of Technology, an AKTU-affiliated college. If you own the copyright and want it removed, email learnwithskillnest@gmail.com and we will take it down.