0% found this document useful (0 votes)
92 views

Python Second Sessional_IT_24-25

Uploaded by

bittu4554gn
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

Python Second Sessional_IT_24-25

Uploaded by

bittu4554gn
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Roll No :

IIMT COLLEGE OF ENGINEERING, GREATER NOIDA


B TECH
FIRST SESSIONAL TEST (ST-2) EXAMINATION (ODD SEM)-2024-25
Course Name: Python Programming Course Code: BCC-302
Program: B. Tech Semester: III Branch:
Date of Exam: 18/12/2024 Duration: 1.30 Hours Max. Marks: 50
Note: Attempt all Sections. If require any missing data; then choose suitably.

SECTION-A
1. Attempt ALL parts. 2 x 5 = 10
Q no. Questions Marks Cognitive CO
level
(a) What is a variable in Python, and how do you declare one? 2 R (BL 1) 1
(b) List at least four basic data types in Python and briefly describe each. 2 R (BL 1) 1
(c) How do if, else, and elif blocks work in Python? Explain with an example. 2 R (BL 1) 2
(d) What is sort(reverse=true) function in python. 2 U (BL 2) 3
(e) What is Tuple in python? 2 R (BL 1) 3

SECTION-B
2. Attempt any TWO Parts 5 x 2 = 10
Q no. Questions Marks Cognitive CO
level
(a) What is Python programming? Explain the various features of Python programming? 5 R (BL 1) 1
(b) Briefly explain the bitwise and logical operator in python. 5 R (BL 1) 2
(c) Construct a program to change the contents of the file by reversing each character separated 5 U (BL 2) 3
by comma:
Sample - Hello!!
Output
H,e,l,l,o,!,!

3. Attempt any TWO Parts 5 x 2 = 10


Q no. Questions Marks Cognitive CO
level
(a) WAP to check prime or not given by user. 5 R (BL 1) 2
(b) What do you mean by recursion? Write a recursive function to compute the factorial of an 5 U (BL 2) 3
input number N.
(c) Write a Python code that checks if a number is positive, negative, or zero and prints an 5 R (BL 1) 2
appropriate message.

SECTION C
Q no. Questions Marks Cognitive CO
level
(a) Explain Ternary Operator in Python. WAP in python to check year is leap year or 10 U (BL 2) 1
not using ternary operator.
(b) Define functions in Python. How are they useful in organizing code? Illustrate with an 10 R (BL 1) 3
example.
4. Attempt any ONE Part 10x1=10
5. Attempt any ONE Part 10x1=10
Q no. Questions Marks Cognitive CO
level
(a) Write difference between list and tuple? Concatenate two lists in the following order 10 U (BL 2) 3
list1 = ["Hello ", "take "]
list2 = ["Dear", "Sir"]
Expected output:
['Hello Dear', 'Hello Sir', 'take Dear', 'take Sir']
(b) Illustrate different list slicing constructs for the following operations on the 10 U (BL 2) 3
Signature (Subject Teacher/Subject Coordinator) Signature (HOD)

Page 1 of 2
Roll No :

following list:
L = [1, 2, 3, 4, 5, 6, 7, 8, 9]
1. Return a list of numbers starting from the last to second item of the list
2. Return a list that start from 3rd item to second last item.
3. Return a list that has only even position elements of list L to list M.
4. Return a list that starts from the middle of the list L.
5. Return a list that reverses all the elements starting from element at index 0 to middle index
only and return the entire list.
Divide each element of the list by 2 and replace it with the remainder.

Signature (Subject Teacher/Subject Coordinator) Signature (HOD)

Page 2 of 2

You might also like