Arulmigu Meenakshi Amman college of Engineering
Vadamavandal-604410.
Anna University Model Examinations
CS25C02-Computer Programming: Python
Time: 3 hrs. Maximum: 100 Marks
[Link]. Questions Marks
Part-A ( 10X2=20)
1. What is problem solving in Python? 2
2. Define an algorithm. 2
3. Compare if and if-else statements in Python. 2
4. What is a for loop in Python? 2
5. State the purpose of using functions in Python. 2
6. What is the purpose of using default arguments in Python? 2
7. How do you compare two strings in Python? 2
8. What is the output of the expression (1, 2, 3) + (4, 5, 6) in Python? 2
9. How do you open a file in Python? 2
10. What is the difference between the w and x modes in Python? 2
Part-B ( 5X13= 65)
11a Write a Python program to solve the following problem: 13
A company has a list of employees with their names, ages, and salaries.
Write a program to find the average salary of employees in each age group
(20-29, 30-39, 40-49, etc.).
Or
11b Create a problem analysis chart in Python to analyze the following 13
problem:
A company is experiencing a decline in sales. The management wants to
identify the causes of the decline and develop a plan to improve sales.
12a What are the control structures available in Python? Explain each control 13
structure with an example.
Or
12b Explain the for loop, nested loops, and pass statements in Python with 13
examples.
13a What are functions in Python? Explain the types of functions, function 13
arguments, and function return values with examples.
Or
13b How can functions be used to hide redundancy and complexity in Python 13
code? Provide examples to illustrate your answer.
14a What are strings and collections in Python? Explain the different types of 13
collections and provide examples.
Or
14b What are tuples and dictionaries in Python? Explain their characteristics, 13
creation, and common operations.
15a How do you perform file operations in Python? Explain the different 13
modes of file opening, reading, writing, and closing files.
Or
15b How do you write, append, and close files in Python? Explain the different 13
modes of file opening and provide examples.
Part-C (1X15=15)
16a How do you manipulate directories and use the OS and Sys modules in 15
Python? Explain the different functions and provide examples.
Or
16b What are packages in Python and how do you create, import, and manage 15
them? Explain the different types of packages and provide examples.