Total No. of Questions : 8] SEAT No.
P4937 [Total No. of Pages : 3
[5667]-1008
F.E. (Semester - I)
PROGRAMMING & PROBLEM SOLVING
(2019 Pattern)
Time : 3 Hours] [Max. Marks : 70
m
Instructions to the candidates :
1) Solve Q.1 or Q.2, Q.3 or Q.4, Q.5 or Q.6, Q.7 or Q.8.
co
2) Neat diagrams must be drawn wherever necessary.
3) Assume suitable data wherever necessary.
s.
Q1) a) What is function? Explain code reuse. Explain with example Docstring.
on
[6]
b) Explain Lambda function with example. [6]
iti
c) Write python program using function to find greatest of three numbers
by passing numbers as argument. [6]
ttu
OR
Q2) a) Differentiate between Local & Global variable. Write a python program
en
to demonstrate difference between local and global variable. [6]
b) Explain keyword arguments in python. Write a python program to
om
demonstrate keyword arguments. [6]
c) Write python program using function to find whether number is odd or
even. [6]
m
st
Q3) a) Explain following string methods with example. [6]
la
i) Rindex
ii) Z fill
iii) Split
b) Write a python program to display tables from 1 to 10 using formatting
character. [6]
P.T.O.
c) What will be the output of following statement S = “Welcome to Python”.
[5]
i) Print (s[1:9])
ii) Print (s[ :6])
iii) Print (s[4: ])
iv) Print (s[1: –1])
v) Print (“Come” not in str)
OR
m
Q4) a) Explain following string methods with example : [6]
i) Join
co
ii) Enumerate
s.
iii) 1 strip
b) Write python, program to find whether a given character is present in a
not use built in string method. on
string or not. In case it is present print the index at which it is present. Do
[6]
iti
c) Write a python program to check whether a given string starts with
specified character. [5]
ttu
en
Q5) a) Define programming paradigm. List programming paradigms. Explain
any one. [6]
Justify the statement “Inheritance helps to make reusable code”.
om
b) [6]
c) Write a python program that uses class to store exam number and marks
of four subjects. Use list to store the marks of four subjects. [6]
m
OR
st
Q6) a) Explain following Terms : [6]
i) Data Abstraction & Encapsulation
la
ii) Polymorphism
b) With the help of an example explain the significance of the inif ( ) method.
[6]
c) Write a python program to create class car with two attributes name &
cost. Create two objects and display information. [6]
[5667]-1008 2
Q7) a) Write a python program that reads data from one file and write into
another file and line by line. [6]
b) What is directory? List any four directory methods and explain any two
of them. [6]
c) Why do we need files? Explain relative and absolute path in files. [5]
OR
Q8) a) Write a python program that counts the number of tabs and new line
characters in a file. [6]
m
b) Write a python program to display current directory, create directory
and remove created directory. [6]
co
c) Differentiate between text and binary files. Explain any 4 access modes
used in python. [5]
s.
on
iti
ttu
en
om
m
st
la
[5667]-1008 3