Python QB
Python QB
MODULE – I
PART-A (2 MARKS)
2. What is the use of comments?How to define single line and multi line comments
3. Define Identifiers.
5. Define variables.
8. What is an expression?
14. What is the use of ‘sep’ and ‘end’ parameter in print () function?
PART-B (6 MARKS)
PART-C (8 MARKS)
4. Examine the type conversion and its types with suitable program.
MODULE – II
PART-A (2 MARKS)
11. Write a python program to extract email address from a string using regular
expressions.
12. Write the python code to create a list with mixed data types.
PART-B (6 MARKS)
2. Construct a python program to find the largest among three numbers using nested if
statement.
7. Create a python code to append some items with list and to find the maximum and
minimum values from the list.
8. Create a python program to implement the below process using tuple methods:
(iii) Compare elements of two tuples (iv) find the first occurrence of the given
value.
10. Demonstrate row selection, addition and deletion in python pandas dataframe.
11. Discuss the below data frame operations : sorting data, filtering data, combining
logical operations.
PART-C (8 MARKS)
(i) for loop & for loop with else (ii) while loop & while loop with else
(i) Concatenation (+) (ii) repetition (*) (iii) slicing (iv) updating
6. Illustrate any 4 special sequences used in python regular expressions with suitable
program.
10. Demonstrate the different Ways to create a data frame using various inputs.
11. Construct python code to create a pandas dataframe from dictionary of list and to
implement isnull(), fillna(), dropna() methods.
MODULE – III
PART-A (2 MARKS)
5.What is a function ?
10.What is a file?
13.What is an Exception ?
14.Give some examples for common in-built exceptions
15.What is the difference between else and finally block in exception handling
16.What is assertion
17. What are the different modes in which a file can be opened?
PART-B (6 MARKS)
13. Illustrate the below numpy array operations: Joining, splitting, searching, sorting
PART-C (8 MARKS)
4.Create a user defined module with basic calculator operations . Explain how to use this
module in another python program
5.Explain the functions used in reading and writing operations in files
MODULE – IV
PART-A (2 MARKS)
1. Define class
2. Define object
3. Define data encapsulation
4. Define data abstraction
5. Define polymorphism
6. Define inheritance
7. Define method overriding
8. What is the use of ‘self’ keyword?
9. What is the use of ‘cls’ keyword?
10. What are magic methods?
11. What are instance attributes and instance methods?
12. What are class attributes and class methods?
13. What are properties? Why do we need them?
15. Create a python program to implement the numpy array arithmetic perations.
16. Differentiate numpy copy() and view() with suitable example.
PART-B (6 MARKS)