Python QB
Python QB
Marks[ 08 ]
1) List different data types in Python.
2) List features of Python. (Imp)
3) State how to perform comments in Python.
OR
How to give single & multiline comment in python.
4) Name different modes of python.
5) Explain variable in Python with its rules and conventions for declaration?
6) Describe Python Interpreter.
7) Determine various data types available in Python with example.
OR
List & explain different data types in Python.
8) Write the steps to install Python and to run Python code.
9) Describe the role of identation in python. (Imp)
10) Describe the python building block
OR
Describe the following terms. (Imp)
i) Identifier ii) Literal iii) Keyword iv) Variable
11) Enlist application for python programming.
12) Explain building blocks of python.
Unit No 2. Marks[ 10 ]
1) Mention the use of //, **, % operator in Python.
2) list & write use of identity operator in python.
3) Describe any two identity operators and two relational operators in Python.
4) Explain two Membership and two logical operators in python with appropriate
examples.
5) Explain the conditional statement in details. [IMP]
[if-else, nested-if else(elif statement)]
6) Explain the Looping statement in details.
[for loop, whil loop, nested loop]
7) Explain the term Continue statement, break statement, pass statement with example.
[IMP]
A.A.Pawar
8) Explain relational , arithmetic & bitwise operators in python with examples.
9) Explain membership & Identity operators in python.
10) Explain use of Pass & else keyword with for loops in python.
Unit No 3. Marks[ 14 ]
1) Define tuple in python? How to create and access it?
2) Explain why tuples are called as immutable.
3) Use of any four methods of tuple in python?
4) Describe any four methods of lists in Python.
5) Describe Dictionary.
6) Compare list and tuple. [IMP]
7) Enlist built in function in list & dictionaries and explain any two.
8) List & Explain built in function on set in python with example.
9) Describe basic operations perform on list with example.
10) Explain the basic dictionaries operations with an example.
11) Explain the basic operations that can be performed on tuple.
12) Explain any four set operations with example.
13) Write the output for the following if the variable fruit=’banana’: [IMP]
>>>fruit[:3]
>>>fruit[3:]
>>>fruit[3:3]
>>>fruit[:]
14) Show the output for the following: [IMP]
1. >>> a=[1,2,3]
>>>b=[4,5,6]
>>> c=a+b
2. >>>[1,2,3]*3
3. >>>t=[‘a’,’b’,’c’,’d’,’e’,’f’]
>>>t[1:3]=[‘x’,’y’]
>>>print t
A.A.Pawar
16) write the output of the following. [IMP]
a) >>> a = [2, 5, 1, 3, 6, 9 , 7]
>>> a = [2 : 6] = [2, 4, 9, 0]
>>> print(a)
c) >>> t1 = [3, 5, 6, 7]
>>> print (t1 [2])
>>> print (t1 [-1])
>>> print (t1 [ 2: ])
>>> print (t1 [ : ])
17) Explain different functions or ways to remove key : value pair from Dictionary.
Unit No 4. Marks[ 14 ]
1) Define function & it’s syntax in Python.
2) Explain Local Variable & Global Variable.
OR
Compare Local Variable & Global Variable.
3) List & Explain standard packages of python.
4) Explain how to use user defined function in python with example. [IMP]
OR.
Write a program use of user defined package in python.
5) Describe module in Python with its advantages?
6) Explain use of namespace in python.
7) Use of NumPy.
OR
Explain Package Numpy with example.
8) write a program for importing module for addition & substraction of two no.
9) write python program using module, show how to write & use module by importing it.
Unit No 5. Marks[ 12 ]
A.A.Pawar
1) List built in class attributes.
2) List different object oriented feature supported by python.
3) Describe the concept of inheritance in python with example.(all types)
OR
Write a program to implement the concept of inheritance in python. (IMP)
4) Define class & object in python.
5) Explain method overloading & method overriding in python with example. (IMP)
6) Explain concept Data Hiding & Data Abstraction .
7) Define __init__() method with example
Unit No 6. Marks[ 12 ]
1) Write the syntax of fopen? [imp]
2) Explain different modes of opening a file. [imp]
3) Design a python program which will throw exception if the value entered by
user is less than zero.
4) Show how try…except blocks is used for exception handling in Python with
example. (mimp)
OR
Explain try-except block used in exception handling in Python with example.
5) Write a python program to read contents of first.txt file and write same content
in second.txt file. (IMP)
6) Write steps involved in creation of a user defined exception?
7) Describe various modes of file object? Explain any two in detail.
8) State the use of read() & readline() functions in python file handling.
9) Describe various modes of file object? Explain any two in details.
10) Explain seek () & tell () function for file pointer manipulation in python with
example.
A.A.Pawar
*********************Program**********************
1) Write a python program to print factorial of a number. Take input from user.
2) Write a python program to print Fibonacci series up to n terms.
3) Write a python program to check whether given Number is even or odd.
4) Write a python program to read contents of first.txt file and write same content in second.txt file
OR
Write a pythom program to read contents of ‘abc.txt’ file and write same content in ’ xyz.txt’ file.
5) Design a python program which will throw exception if the value entered by user is less than zero.
6) Write a Python program to concatenate two strings.
7) write a python program to calculate area of reactangle & area of square using method overloading.
8) write a python program to demonstrate the use of any six built in mathematical functions.
9) Design class reactangle with data members length & breadth. Create suitable method for reading
And printing the area & perimeter of rectangle.
10) write a python a program to print the following pyramid.
*
**
***
11) write a python a program to swap value of two variable.
12) write a python a program to generate six random integers between 20 to 50.
13) write a python a program to add two number using function.
14) write a python a program to open a file in write mode & append some contents at the end of file.
15) write a python a program to print following
1
1 2
1 2 3
1 2 3 4
OR
2
4 6 8
10 12 14 16 18
16) Write a program to create class student with Roll no & Name & display its
contents.
A.A.Pawar