0% found this document useful (0 votes)
355 views4 pages

Model Paper Python BCC402

previous paper
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
355 views4 pages

Model Paper Python BCC402

previous paper
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

Roll No :

IIMT COLLEGE OF ENGINEERING, GREATER NOIDA


B. TECH.
MODEL PAPER, EVEN SEMESTER (2023-24)
----------------------------------------------------------------------------------------------------------------------------- --------------------------------
SUBJECT: PYTHON PROGRAMMING SUBJECT CODE: BCC 402
PROGRAM: B. Tech BRANCH: AI&DS SEMESTER: 4th
DATE OF EXAM: DURATION: 3 HOURS. MAX. MARKS: 70
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note: Attempt all Sections. If require any missing data; then choose suitably.

SECTION-A

1. Attempt all questions in brief. 2 x 10 = 20

Q no. Question Marks CO


a. Discuss why Python is called as dynamic and strongly typed language? 2 1
b. How pass statement is different from a comment? 2 1
c. Discuss the purpose of the break and continue statement in loops. 2 2
d. How to use the functions defined in library.py in main.py. 2 2
e. Define seek( ) and tell( ) function in file handling. 2 3
f. Discuss various file opening modes of python. 2 3
g. Describe about different functions of NumPy and Pandas. 2 4

SECTION-B

2. Attempt any three of the following: 10 x 3 = 30

Q no. Question Marks CO

Illustrate Unpacking tuples,mutable sequence and string concatenation with


a. 10 1
example.
b. Explore the working of while, and for loop with examples. 10 2
Construct a function perfect_square(number) that returns a number if it is
a perfectsquare otherwise it returns -1.
c. For example: 10 3
perfect_square(1) returns 1
perfect_square (2) returns -1.
Construct a program to change the contents of the file by reversing each character
separated by comma:
d. Hello!! 10 4
Output
H,e,l,l,o,!,!.
Signature (Subject Coordinator/Teacher) Signature (HOD)
Page 1 of 4
Roll No :

Construct a plot for following dataset using matplotlib :

e. 10 5

SECTION C

3. Attempt any one part of the following: 10 x 1 = 10

Q no. Question Marks CO


Discuss why python is interpreted language. Explain history and features of
a. 10 1
python while comparing python version 2 and 3.
Determine a python function removenth(s,n) that takes an input a string and an
integer n>=0 and removes a character at index n. If n is beyond the length of s,
b. then whole s is returned. For example: 10 1
removenth(“MANGO”,1) returns MNGO
removenth(“MANGO”,3) returns MANO
4. Attempt any one part of the following: 10 x 1 = 10

Q no. Question Marks CO


Write a program that accepts sequence of lines as input and prints the lines after
a. making all characters in the sentence capitalized. 10 2
e.g. If Input:
Signature (Subject Coordinator/Teacher) Signature (HOD)
Page 2 of 4
Roll No :

Hello world
Practice makes perfect
Then, Output:
HELLO WORLD
PRACTICE MAKES PERFECT
Write a Python program to Swapping of two numbers with and without using
b. 10 2
temporary variable.
5. Attempt any one part of the following: 10 x 1 = 10

Q no. Question Marks CO


What do you mean by recursion? Write a recursive function to compute the
a. 10 3
factorial of an input number N.
A website requires the users to input username and password to register.
Construct a program to check the validity of password input by users.
Following are the criteria for checking the password:
1. At least 1 letter between [a-z]
2. At least 1 number between [0-9]
3. At least 1 letter between [A-Z]
b. 10 3
4. At least 1 character from [$#@]
5. Minimum length of transaction password: 6
6. Maximum length of transaction password: 12
Your program should accept a sequence of comma separated passwords and will
check them according to the above criteria.
Passwords that match the criteria are to be printed, each separated by a comma.
6. Attempt any one part of the following: 10 x 1 = 10

Q no. Question Marks CO


a. Change all the numbers in the file to text. Construct a program for the same. 10 4
Example: Given 2 integer numbers, return their product only if the product is
equal to or lower than 10.
And the result should be:
Given two integer numbers, return their product only if the product is
equal to or lower than one zero
b. Construct a program which accepts a sequence of words separated by whitespace 10 4
as file input. Print the words composed of digits only.
7. Attempt any one part of the following: 10 x 1 = 10

Q no. Question Marks CO


a. Design a calculator with the following buttons and functionalities like addition, 10 5
subtraction, multiplication, division and clear.
b. Get total profit of all months and show line plot with the following Style properties 10 5
Generated line plot must include following Style properties: –
 Line Style dotted and Line-color should be red
 Show legend at the lower right location.
Signature (Subject Coordinator/Teacher) Signature (HOD)
Page 3 of 4
Roll No :

 X label name = Month Number


 Y label name = Sold units number
 Add a circle marker.
 Line marker color as read
 Line width should be 3

Signature (Subject Coordinator/Teacher) Signature (HOD)


Page 4 of 4

You might also like