.Trashed 1751450465 Bsc Computer Science Cs Semester 5 2023 November Python Programming r Programming 2019 Pattern
.Trashed 1751450465 Bsc Computer Science Cs Semester 5 2023 November Python Programming r Programming 2019 Pattern
:
P6396 [Total No. of Pages : 3
[6155]-57
T.Y. B.Sc. (Computer Science)
CS-3510 : PYTHON PROGRAMMING
(Revised 2019 Pattern) (CBCS) (Semester - V)
Time : 2 Hours] [Max. Marks : 35
Instructions to the candidates:
1) All questions are compulsory.
2) Figures to the right indicate full marks.
3) Total number of questions are five.
a) What is indentation?
b) Write code to print the elements of the list 11 = [10, 20, 30, 40, 50]
b) What are the usage of tuples zip (), tuple(), count() and index() functions?
[6155]-57 1 P.T.O.
c) What is an anonymous function? How to create it? Explain with example.
[6155]-57 2
Q5) Attempt any one of the following: [1×3=3]
a) Check1 = ['Learn', 'Quiz', 'Practice', 'Contribute']
Check2 = check1
Check3 = check1 [:]
Check2[0] = 'Code'
Check3[1] = 'Mcq'
Count = 0
For c in (check 1, check2 check3):
if c[0] == 'Code':
count + = 1
if c[1] == 'Mcq':
count + = 10
print (count)
b) Counter = {}
Def add To Counter (Country):
If country in counter:
Counter [country] + = 1
Else:
Counter [country] = 1
Add To Counter ('China')
Add To Counter ('Japan')
Add To Counter ('china')
Print (len(counter))
[6155]-57 3