0% found this document useful (0 votes)
25 views7 pages

Python QB

Uploaded by

mr0299303
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
25 views7 pages

Python QB

Uploaded by

mr0299303
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 7

PYTHON PROGRAMMING and LAB – QUESTION BANK

MODULE – I

PART-A (2 MARKS)

1. List the features of python.

2. What is the use of comments?How to define single line and multi line comments

3. Define Identifiers.

4. What are keywords? List any 5 python keywords.

5. Define variables.

6. Why python programming is called ‘Dynamically-Typed’?

7. List the python built-in core data types.

8. What is an expression?

9. Explain statement in python.

10. Write the difference between expressions and statements.

11. Define the usage of indentation in python programming.

12. List the identity operators. Explain its use.

13. List the membership operators. Explain its use.

14. What is the use of ‘sep’ and ‘end’ parameter in print () function?

15. Define type conversion.

PART-B (6 MARKS)

1. Illustrate the use of comments in python with its types.

2. Differentiate between Tuple and List.

3. Demonstrate the use of identity operators with an example.

4. Demonstrate the use of membership operators with an example.

5. Demonstrate the use of format () method with an example.

PART-C (8 MARKS)

1. Illustrate the python built-in core data types.


2. Demonstrate the different types of operators in python with suitable examples.

3. Illustrate the input and output operations in python with examples.

4. Examine the type conversion and its types with suitable program.

MODULE – II

PART-A (2 MARKS)

1. Define the use of decision making statements.

2. Write the syntax of nested if statement.

3. Write the syntax of if-elif ladder statement.

4. Explain the use of range() function.

5. List the python loop control statements.

6. List the escape sequences.

7. List any 4 string built-in methods.

8. How to specify the docstrings in python.

9. Write the difference between re.search() and re.findall().

10. What is the use of curly braces in python regular expressions?

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.

13. Differentiate IndexError and TypeError.

14. Write the python code to create a dictionary using dict().

15. Distinguish between pop() and popitem() method.

16. Differentiate mutable and immutable.

17. Define tuple packing.

18. Write a python code to refer the last item of a tuple.

19. List the characteristics of set.

20. Differentiate discard() and remove() methods in set.

21. List the features of dataframe.


22. Explain the constructor to create a python pandas dataframe.

23. Give the expansion for PANDAS and NUMPY.

24. List the uses of numpy.

PART-B (6 MARKS)

1. Demonstrate if-elif ladder with program.

2. Construct a python program to find the largest among three numbers using nested if
statement.

3. Differentiate break and continue with examples.

4. Demonstrate the use of pass statement with an example.

5. Discuss the following string methods: len(), capitalize(), split(), replace()

6.Demonstrate the sort() and set() method for comparing list.

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:

(i) Find the length of a tuple (ii) Converting list to a tuple

(iii) Compare elements of two tuples (iv) find the first occurrence of the given
value.

9. Demonstrate column selection, addition and deletion in python pandas dataframe.

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)

1. Demonstrate the types of decision making statements with suitable examples.

2. Illustrate the following:

(i) for loop & for loop with else (ii) while loop & while loop with else

3. Demonstrate the importance of loop control statements with suitable program.


4. Illustrate the below string operations with examples.

(i) Concatenation (+) (ii) repetition (*) (iii) slicing (iv) updating

5. Examine any 4 Meta character classes with example.

6. Illustrate any 4 special sequences used in python regular expressions with suitable
program.

7. Illustrate the following list operations: concatenation, repetition, slicing, deletion

8. Demonstrate the python dictionary methods with an example.

9. Illustrate python set operations with sample coding.

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)

1.What is recursion in python

2.What is a module ? List built_in modules in python

3.What is help() function in python

4.What is sys() function in python

5.What is a function ?

6. What are docstrings ?

5.What is scope of variables?List two types of scope

6.What are the advantages of python modules

7.What is module aliasing? give an example

8. What is import statement in python

9.What are the two types of files in python

10.What is a file?

12.What are the various file handling operations

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)

1)What are the advantages and disadvantages of recursion

2)Explain random module with example

3)Explain math() module with example

4)How to define a function in python.Explain with example

5) Explain return statement with example

6.Explain two types of scope with example

7. What is usage of Global Keyword?Explain with example

8.Explain member aliasing with example

9.How to create a file in python.Explain with example

10.Explain try..except block with example

11.Explain finally with example

12.Explain with an example for multiple exception

13. Illustrate the below numpy array operations: Joining, splitting, searching, sorting

PART-C (8 MARKS)

1.With example explain recursion in detail

2. Explain the following with example:

a)Calling Function without arguments

b)Calling Function with arguments

3. Explain in detail three types of arguments (default, keyword and arbitrary


arguments) in function with sample code

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

6.How to raise a exception with message

7.Explain assertion with example

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?

14. Compare and contrast numpy arrays and python lists.

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)

1. Explain in detail the basic concepts of OOPS.


2. Explain the life cycle of an object
3. Explain the types of inheritance with relevant diagrams.
4. Demonstrate the usage of instance attributes and instance methods with a
program
5. Demonstrate the usage of class level attributes and class level methods with a
program
6. How data hiding can be achieved in a class? Explain with an example
PART-C (8 MARKS)

1. Demonstrate the concept of method overriding with an example


2. Explain single level and multi level inheritance with example code for each.
3. Write a note on a) __init__ b) __new__ c) __del__
4. Explain hierarchical inheritance with an example

You might also like