Python Sem 3 Paper
Python Sem 3 Paper
Code: BCC302
PAPER ID-311224
Subject
Roll No:
BTEC!1
22oosoolo8
(SEM II) THEORY EXA
PYTHON MINATION 2023-24
TIME: 3HRS PROGRAMMING
M.MARKS: 70
Note: 1. Attempt all Sections. It require any missing
data: then choose
suitably
STCTION A
1. Attempt all questions in brief.
|Qno
Qustio
Marks
Deseribe the concept of.list comprehenion with suitable exannpie
ia
Differeniate between and // operator NIth an cxample
/
C
Compute the output of the following p thon code:
2
def count(s):
S
"&"join(str)
returns
Output
H.e,l.l.o,!,!
Galaxy A23
Printed Page: 2 of 3
PAPERID-311224 Subject Code: BCC302
Roll No:
BTECH
(SEM II) THEORY
EXAMINATION 2023-24
PYTHON PROGRAMMMING
TIME: 3HRS 70
M.MARKS:
Meat 250 40 8
Banana 130 55
Avocados 140 20
Sweet
Potatoes 120 30 6
Spinach 20 40
1
Watermelon 20 32 1.5
Coconut
water 10 10
Beans 50 26 2
Legumes 40 25 1.5
Tomato 20 2.5
SECTION C
3.
Attempt any one part of the following:
a.
Determine a pvthon function remove1i(s,n) that takes an input a string and an
integer n>=0and removes a character at index n. Ifn is beyond the length of s.
then whole s is returned. For example:
A website requires the users to input usename and passwordto registcr. Construct 7
a program to check the validity of passvord input by users.
Your program should accept a sequenceof comma separated passwords and will
check them according to the above criteria. Passwords that match the criteria
are
to be printed, cach separatcd by a
comrma
b. Explorethe working of while, and for loop with examples.
5. Attempt any one part of the following:
ret smaller(| [-2, -1, 0, 0.12, 1, 21. (3.1, 51. [6.7,8,9. 101,(11,12, 13, 14, 1511)
returas [3,4,5)
ret smaller([ -2, -1, 0, 0.12, 1, 2], ['a, "b', 'c,d', 3, 4, 5], [6,7,8,9, 10], (11,
[
12, 13,14,15]])) returns [6,7, 8,9, 1O
7
b Construct following filters:
Ramesh, Tomato,Patna.
to clean the text.
Create program that inmplements these
a
tilters
Example:
the product is equal to or lower
product only if
Given 2 integer numbers, return their
than 10.
And the result should be:
the product is equal to or
return their product only if
of the following:
7. Attempt any one part
remove last column and save
it in