Papers / AKTU / B.Tech / Python Programming
AKTU · B.Tech · 3rd semester

AKTU Python Programming (BCC302) Question Paper 2024-25

UniversityDr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow
CourseB.Tech, Semester III
SubjectPython Programming (BCC302)
ExamTheory Examination 2024-25 (odd semester)
Time · Marks3 hours · 70 marks
SourceAKTU question paper, from the ABESIT question paper bank
View original PDF Other years

Note: Attempt all Sections. In case of any missing data; choose suitably.

Section A

Q1. Attempt all questions in brief · 2 × 7 = 14 marks

  1. State how to handle exceptions in Python? Provide a simple example.
  2. 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]))
  3. Explain floor division with an example
  4. Describe the purpose of the ‘with’ statement in file handling?
  5. Briefly describe the use of lambda functions in Python.
  6. Demonstrate how to assign a single value to a tuple.
  7. 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

  1. Design a basic calculator in Python that supports addition, subtraction, multiplication, division.
  2. Define Membership and Identity Operators.
    Given:
    a = 3
    b = 3
    Distinguish between: (a is b) and (a = = b) ?
  3. 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}
  4. Write a program to reverse the contents of a file character by character, separating each character with a comma.
  5. Create a pie chart using matplotlib to represent the following data:
    Languages Popularity
    Python 30
    Java 25
    C++ 20
    JavaScript 15
    Ruby 10

Section C

Q3

Attempt any one part of the following · 7 × 1 = 7 marks

  1. Write short notes on the following with examples: a) Operator Precedence b) Python Indentation c) Type Conversion
  2. Write a program to validate email addresses using regular expressions.
    Criteria:
    1. Must contain @ symbol
    2. Must contain domain name
    3. Should not have spaces

Q4

Attempt any one part of the following · 7 × 1 = 7 marks

  1. Write a program to create a hollow pyramid pattern given below:
    *
    * *
    * *
    * *
    *********
  2. 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

  1. 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'])
  2. 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

  1. Discuss different types of file modes in Python? Explain with examples.
  2. 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

  1. Discuss the role of event handling in Tkinter. How can you bind events to widgets? Provide examples.
  2. Write a program to read data from a CSV file 'students.csv', calculate the average marks for each student, and display the results.

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.