Python QB(u1-3)
Python QB(u1-3)
Python QB(u1-3)
CO’s Bloom’s
Q.No Questions
Level
PART A
1. What is python and list the features of python. CO1 K2
2. Define a variable and assign it the value "John" to a variable. CO1 K1
3. Why are comments important in Python code? CO1 K2
4. What is the Python interactive mode? CO1 K2
5. How do you create a Python script file using a text editor? CO1 K3
6. Differentiate an expression and a statement in Python. CO1 K4
7. What is the significance of indentation in Python? CO1 K1
8. Represent the result of the following expression 5 + 3 * 2? CO1 K2
9. Explain the use of the // operator in Python. CO1 K2
10. Define keywords in Python and give an example. CO1 K2
11. What is an identifier in Python? CO1 K2
12. Explain the rules for naming variables in Python. CO1 K2
13. What is the difference between = and == in Python? CO1 K2
How does the "elif" statement differ from multiple "if" statements in
14. CO1
terms of execution? K2
15. Explain the use of break and continue statements in Python CO1 K2
16. What is recursion? Give an example. CO1 K2
17. Compare map(), filter(), and reduce() functions in Python. CO1 K1
What is the use of the return statement in function. Give anyone own
18. CO1
example. K2
Define the user defined function in python. Give its syntax and
19. CO1
example. K2
20. Discuss the purpose of the global keyword in Python functions CO1 K2
CO’s Bloom’s
Q.No Questions
Level
Part – B
a. Write a python program to add two numbers entered by the
1. user.(6) CO1 K3
b. Write a python program to calculate the area of a circle. (7)
2. Develop a python program to compute the sum of digits of a given CO1 K3
number.
a. Write a Program to find the average of five subject marks. (6)
b. An employee working in a company and getting a salary of 35000,
3. CO1 K3
after promotion an employee gets 10% increment. Write a python
program to find the current salary. (7)
i) Write a python program to perform calculator using function (6)
4. ii) Write a python program to find the given year or leap or not using CO1 K2
function (7)
i) Write a python program to find the given number is Armstrong or
not. (6)
5. CO1 K3
ii) Write a python program to find the given number is palindrome or
not (7)
i) Write a Python program to print counting from 1 to 10 using for loop
with break statement (6)
6. CO1 K3
ii) Program to add two numbers using function by passing arguments
with and without return statement (7)
i) Write a Python program that utilizes a for loop with a break
statement to print numbers from 1 to N, and ensures the loop breaks
when the count reaches 10. (6)
7 CO1 K3
ii) Write a python program to the following scenario, A man given to
a principle amount of rupees 10000 after the two years duration what
will be the amount in his hand with rate of interest 5%. (7)
CO’s Bloom’s
Q.No Questions
Level
Part C
i) Write a python Program to find the factorial of a number using
1. Recursion(7) CO1 K3
ii) Write a python program to find sum of digits using Recursion (8)
Write a python program to perform inter changing of two value of
2. CO1 K3
variable using call by value and call by reference.
CO’s Bloom’s
Q.No Questions
Level
Part A
1. Write a python program to calculate the length of the given string. CO2 K3
2. Write a python program to count repeated characters in a string. CO2 K3
3. Illustrate any two list operations with example. CO2 K3
How do you create a list in python? Illustrate the use of negative
4. C02 K3
indexing of list with example.
Given the list numbers = [1, 2, 3, 4, 5], write a list comprehension to
5. CO2 K3
create a new list containing only the even numbers from numbers.
6. Write a program to create a tuple with different data types. CO2 K3
7. IIustrate how tuples are used as return values. CO2 K3
8. How a tuple is iterated? Explain with an example. CO2 K2
9. What are the advantages of Tuple over List? CO2 K2
How can you count the number of times the element 2 appears in the CO2
10. tuple K3
t = (1, 2, 3, 2, 4, 2)?
11. Define cloning in list. CO2 K2
12. List two dictionary operations CO2 K2
Let list1 =[‘a1’, ‘b2’, ‘c3’, ‘d4’, ‘e5’, ‘f6’]. CO2
13. K3
Find a)list1[1:-1] b) list1[:] c)list1[-5:-1] d) list1[2:5]
14. What are modules? CO2 K2
15. What are packages? How to import modules from a package? CO2 K2
16. What do you mean by IndexError? CO2 K2
17. Write a Python script to display the current date and time CO2 K3
18. What are the different file modes? CO2 K2
19. How will you update list items Give one example CO2 K3
20. What is difference between list and tuple in python? CO2 K2
CO’s Bloom’s
Q.No Questions
Level
Part b
a) Analyse string slicing, in python with example. (6)
1. CO2 K3
b) Examine the execution to reverse a string using python. (7)
a) Python strings are immutable. Analyse with suitable example. (6)
2. b) Inspect a Python program to find the occurrence of a character in a CO2 K3
string. (7)
Make use of the string methods and perform the following
operations.
i) Reverse a string
3. CO2 K3
ii) Display the string starts with 'A'.
iii) Display the string ends with 'n'.
iv) Convert the string into lower case.
a) Write a program that removes any repeated items from a list so
that each item appears at most once. For instance, the list
4. [2,3,4,3,0,0,5,5,9,9] would become [2,3,4,0,5,9]. (6) CO2 K3
b) Create a list and append the data of the second list to the first list.
(7)
Create a List and perform following operations:
i) Add an item in the 4th position of the list.
5. ii) Remove the 3rd item in the list CO2 K3
iii) Replace the 6th item with new item
iv) Remove the duplicate items from the list
Write a python program to count the frequency of characters in a
6. string (6) CO2 K3
Write a python program to create a Phonebook using Dictionary (7)
What are the modules in python? How will you import them? Explain
7 CO2 K3
the concept by creating and importing a module?
8 Explain in detail about packages in python with the help of example. CO2 K3
CO’s Bloom’s
Q.No Questions
Level
Part- C
Write a python program for Merge Sort and explain the concept using
1. CO2 K3
suitable example
Write a Python program to implement stack operations using
2. CO2 K3
modules.
CO’s Bloom’s
Q.No Questions
Level
Part A
1. Write a python program that writes “Hello world” into a file CO3 K3
2. What is a text file? CO3 K2
3. What is a file object? CO3 K2
What information is displayed if we print a file object in the given CO3 K2
4.
program?
5. What are the two arguments taken by the open() function? CO3 K2
6. How do you delete a file in Python? CO3 K3
7. What are the different file operations? CO3 K2
8. What are the different file modes? CO3 K2
9. Write a python program that counts the number of words in a file. CO3 K3
10. Discover the format operator available in files CO3 K2
CO’s Bloom’s
Q.No Questions
Level
Part – B
Write a function that copies a file reading and writing up to 50
1. CO3 K3
characters at a time.
Write a python program to count number of lines, words and
2. CO3 K3
characters in a text file.
Write a Python program to illustrate the use of command-line
3. CO3 K3
arguments.
Tabulate the different modes for opening a file and briefly explain the
4. CO3 K3
same
CO’s Bloom’s
Q.No Questions
Level
Part C
Explain the commands used to read and write into a file to find the
1. most frequent words in the text of the file using command line CO3 K3
arguments
2. Write a Python program to dump objects to a file using pickle. CO3 K3