BHARATI VIDYAPEETH COLLEGE OF ENGINEERING
(DIPLOMA ENGINEERING)
QUESTION BANK
Unit Test-I
Program: - Computer Engineering Group Program Code:- CO
Course Title: Programming with Python Semester: - Sixth
Course Abbr & Code:-PWP (22616) Scheme: I
--------------------------------------------------------------------------------------------------
1. Introduction and Syntax of Python program (08 MARKS)
2 Marks
1. Enlist applications for python programming.
2. Describe the Role of indentation in python.
3. Name different modes of python.
4. How to give single and multiline comment in python.
5. List features of Python.
6. List Data types used in python.
7. List building blocks of python.
4 Marks
1. Explain building blocks of python.
2. List data types used in python. Explain any two with example.
3. Explain with example: i) Indentation ii) Variables
4. Write a simple python program to display message using script mode.
5. Write a python program to calculate area of square and rectangle.
6. Write a python program to calculate rate_of_interest (i/p: Gross_salary, Basic_salary, interest)
7. Differentiate between Interactive mode and Script mode of python.
2. Python operators and control flow structures (10 MARKS)
2 Marks
1. List identity operators in python.
2. Describe membership operators in python.
3. List comparison operators in Python.
4. Write the use of elif keyword in python.
5. Explain use of pass statement.
6. Explain the term: a) continue b) break
4 Marks
1. Write python program to display output like.
4 6 8
10 12 14 16 18
2. Explain use of Pass and Else keyword with for loops in python.
3. Describe bitwise operators in Python with example.
4. Write python program to illustrate if else ladder.
5. Write Python code for finding greatest among four numbers.
6. Print the following pattern using loop:
1010101
10101
101
1
7. Write a python program that takes a number and checks whether it is a palindrome.
8. Write a python program takes in a number and find the sum of digits in a number.
9. Write a Python program to find the factorial of a number provided by the user.
10. Write a Python Program to check if a string is palindrome or not.
11. Explain decision making statements If - else, if - elif - else with example.
3. Data Structures in python (14 Marks)
2 Marks
1. Give two differences between list and tuple.
2. Write syntax for a method to sort a list.
3. What is dictionary?
4. Describe Tuples in Python.
5. Explain two ways to add objects / elements to list.
6. List different operations that can be performed on tuple.
7. List features of set.
8. List operations that can be performed on dictionary.
9. Explain any two methods of dictionary.
4 Marks
1. Compare list and tuple.
2. Explain four Buit-in tuple functions python with example.
3. Explain indexing and slicing in list with example.
4. Write the output of the following :
i) >>> a = [ 2, 5, 1, 3, 6, 9, 7 ]
>>> a [ 2 : 6 ] = [ 2, 4, 9, 0 ]
>>> print (a)
ii) >>> b = [ “Hello” , “Good” ]
>>> b. append ( “python” )
>>> print (b)
iii) >>> t1 = [ 3, 5, 6, 7 ]
>>> print ( t1 [2] )
>>> print ( t1 [–1] )
>>> print ( t1 [2 :] )
>>> print ( t1 [ : ] )
5. Explain creating Dictionary and accessing Dictionary Elements with example.
6. Write a python program to input any two tuples and interchange the tuple variables.
7. Explain any six set function with example.
8. Write the output for the following if the variable
course = “Python”
>>> course [ : 3 ]
>>> course [ 3 : ]
>>> course [ 2 : 2 ]
>>> course [ : ]
9. Explain mutable and immutable data structures.
10. List and explain any four built-in functions on set.