Sub Code: CST-005 ROLL NO……………..……………..
ODD SEMESTER EXAMINATION, 2024 – 25
2nd Year (3rd Sem) [Link].
Python Programming
Duration: 2:00 hrs Max Marks: 50
Note: - Attempt all questions. All Questions carry equal marks. In case of any ambiguity or missing data,
the same may be assumed and state the assumption made in the answer.
Q 1. Answer any two parts of the following. 5x2=10
a) List and explain any four features of Python that make it a popular programming
language.
b) What are Python data types? Provide examples to illustrate the declaration and use
of the following: Numbers, Lists, and Dictionaries.
c) Explain the process of setting up the Python environment. How would you install an
IDE and run a simple Python script?
Q 2. Answer any two parts of the following. 5x2=10
a) List and explain the different types of operators in Python with examples for
Arithmetic and Logical operators.
b) Write a Python program using a conditional statement (if...else) to check whether a
number is positive, negative, or zero.
c) Explain the use of the break and continue statements in Python loops. Write a Python
program to demonstrate their use.
Q 3. Answer any two parts of the following. 5x2= 10
a) Define and differentiate between lists and tuples in Python. Provide examples to
illustrate basic operations for each.
b) Write a Python program to perform the following operations on a string:
Convert to uppercase
Find the length of the string
Reverse the string
c) Explain the concept of sets in Python. Write a program to find the union and
intersection of two sets.
Q 4. Answer any two parts of the following. 5x2= 10
a) Define a function in Python that takes two numbers as arguments and returns their
product. Explain the concept of function arguments and return statements.
b) Write a Python program that imports the math module and uses it to calculate the
square root and factorial of a given number.
c) Explain the difference between modules and packages in Python. Provide an example
of creating a custom package and using it in a Python program
Q 5. Answer any two parts of the following. 5x2= 10
a) Write a Python program to read data from a file, process it, and write the processed
data to a new file
b) Explain the concept of data streams in Python. Write a program to demonstrate
creating and using custom data streams.
c) Explain the key strengths and weaknesses of Python as a programming language.
How do these influence its use in different applications?
******************