Python programming questions
Module 1
1. What are the key features of python programming?
2. What are the different data types in python programming?
3. Describe the structure of an if-else statement.
4. What is the use of break and continue statements?
5. Explain the use of pass statemen with an example.
6. What are the steps to write a python program?
7. What are the different types of loops available in python programming?
8. Explain the concept of nested loop with an example.
9. Write down the features of python programming compared to other programming
languages.
10. What are the basic syntax to write a python program?
11. What is the dynamic use of variables and data types in python programming?
12. Explain different types of operators in python programming? Use proper examples.
13. Differentiate between if, if-else, and elif statements.
14. Explain the working principle of while loop and for loop with real life examples.
Module 2
1. What are the different approaches to access the characters in a string ?
2. How to perform string concatenation and string repeatation?
3. Explain string slicing with proper examples.
4. What is the importance of indexing in string slicing?
5. Explain any five string methods with suitable examples .
6. Give a ideal life scenario where string functions are applied.
7. What is the importance of the split method?
8. What is the importance of loop in accessing the characters from a string?
9. Give an example of the application of join method.
10. 'String is immutable '- justify
11. What is the use of len function?
12. What are the differences between upper and lower method and its variation?
13. Explain the main difference between find and replace method.
14. Give an example use of strip method and its variation.
Module 3
1. What is the purpose of list in python programming
2. How to access different list elements with proper examples
3. Explain all the list methods with examples
4. How to modify an existing list by using append and remove method
5. What are the differences between list and tuple in python programming
6. What is the importance of pop method? Justify your answer.
7. What are the properties of python list?
8. Categorise the list operations into read and modify categories.
9. In which situation list and tuple should be used ? Justify.
10. What are the effects of insert, remove and sort
11. How to differentiate between sort(reverse=true) and reverse method
12. Compare the properties of tuples and list. Justify which is better and why
13. How to access tuple elements?
14. How to use a dictionary data structure to store and access data
15. Why keys and values methods are used in a dictionary
16. Explain the concept of tuple slicing
17. Explain the data string mechanism of list and odictionary
18. What is the difference between get method and direct access in dictionary
19. What is the effect of len function on a dictionary
20. Explain the basic structure of a dictionary
21. How functions and methods work on dictionaries
22. How to manipulate a dictionary using built in method
23. Write down the differences between list, tuple, and dictationary
Module 4
1. What is a function in python programming?
2. Classify functions into different categories and explain each of them.
3. What is the use of an anonymous function(lambda function)?
4. Make a comparison on local and global variables.
5. What do you mean by required arguments?
6. Explain the importance of default arguments.
7. When variable length argument is used to define a function?
8. How does keyword help in passing actual arguments during function call?
9. Design a flow diagram of a calling function and returning values in python.
10. What is the difference between formal and actual arguments?
11. What are the different types of arguments in python programming?
12. What is the use of keyword arguments?Give examples.
13. What are the advantages or disadvantages of recursion?
14. “Every iterative problem can be solved using recursion"- true or false- justify.
15. What is a module in python programming?
16. What are the importance of 'from' and 'import' keywords?
17. What do you mean by aliasing?
18. Explain the usage of math module in python programming?
19. Explain the usage of random module.
20. What are the basic differences between random and randrange method?
21. How can you implement the functionality of uniform method?
22. How does the shuffle method work?
23. Explain the advantages of using packages.
24. What is the difference between read and write mode in file handling?
25. write a program to read data from an existing file.
26. wap to write data to a new file.
27. wap to copy the content of one file to another file.
28. differentiate between read(), readline(), and readlines() method.
29. What is the use of tell() method? explain with example.
30. Why is the seek method important in file handling?
31. What is the importance of closing a file?
32. How to perform file operation in python including reading and writing data?
Module 5
1. Give an example of a constructor method in python.
2. What is the importance of using try, except and finally clause in exception handling?
3. Give an example of an except clause in python.
4. What are the differences between class attributes and data attributes?
5. Give an example of using multiple objects from the same class.
6. Give an example of a custom exception in python.
7. What are the differences between the instance attributes and class attributes?
8. How to use the constructor method to initialise the object values automatically?
9. How does the finally block help to manage the resource cleanup process?
10. What are the differences between built-in and user defined exceptions?
11. What are the advantages of using object oriented programming?
12. What are the steps to create a python class?
13. What do you mean by inheritance in object oriented programming?
14. What do you mean by encapsulation in object oriented programming and give examples
15. What do you mean by polymorphism in object oriented programming?
16. Define a python class to represent the student.
17. What are the advantages of polymorphism in object oriented programming?
18. Explain exception handling in python by using multiple except blocks.
19. What are the characteristics of object oriented programming?
20. Explain the relationship between class and object with proper examples.