Python Programming

  University Question Paper(Jan 2023)

Total No. of Questions: 5]                                                                           SEAT No.:

PA-1029                                                                                        [Total No. of Pages: 3


[5902]-57

T.Y.B.Sc.(Semester-V)

COMPUTER SCIENCE

CS-3510 PythonProgramming

(2019 Pattern) (CBCS)


Time: 2 Hours]                                                                                         [Max. Marks: 35

Instructions to the candidates:                                

        1)Figures to the right indicate full marks.

        2) All Questions are compulsory.

        3) Total number of questions are FIVE.

Q1) Attempt any Eight of the following (Out of Ten)                            [8 × 1 = 8]

a) What are the advantages of Python?

b) List out main differences between lists & tuple. 

c) Python is a scripting language. Comment.

d) Demonstrate set with example. 

e)What is dictionary? Give example.

f)What is regex? give example. 

g)What is user defined Module? Give example.

h) Python is case sensitive language. Comment.

i) What is dry run in Python?

j) What is lambda function? Give example.


02) Attempt any four of the following (Out of Five)                                [4 x 2 = 8]

a) Write a python program to calculate XY

b) Write a python program to accept a number and check whether it is perfect number or not.

c) What is the use of seck() & tell () functions?

d) Demonstrate list slicing.

e)A tuple is ordered collection of items, Comment.


Q3) Attempt any Two of the following (Out of Three).                             [2 x 4 = 8]

a)Write a short note on datatypes in python.

b)Write a short note on exception handling. 

c) What Is a module? What is package? Explain with example.


04) Attempt any Two of the following (Out of Three).                            [2 x 4 = 8]

a) Write a recursive function in Python to display addition of digits in single digit.

b) Write a program in python to accept 'n' integers in a list, compute & display addition of all squares of these integers.

c) Write a Python program to count all occurences of "India" and "Country" in a text file "pledge.txt


Q5) Attempt any One of the following (Out of Two).                          [1 × 3 = 3]

a) What is the output of following code:

X=5

def        fl():

            global X

            X=4

def        f2(a, b):

            global X

            return a+b+X

f1()

total = f2(1, 2)

print (total)

b)What is the output of following code:

def f(X):

def             fl(a, b):

                  print ("hello")

                   if (b==0):

                   return 

            returnf(a,b)

    return f1

@f

def f(a,b):

        return a%b

f(4,0)

THANKS!!!



Post a Comment

0 Comments