0% found this document useful (0 votes)
8 views3 pages

Python Question Bank

The document outlines a comprehensive introduction to Python programming, divided into five modules covering essential topics such as data types, flow control, functions, file handling, and object-oriented programming. Each module includes detailed explanations, examples, and programming tasks to reinforce learning. Key concepts include variable definitions, string methods, list and dictionary operations, and the use of modules like shutil and logging.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Python Question Bank

The document outlines a comprehensive introduction to Python programming, divided into five modules covering essential topics such as data types, flow control, functions, file handling, and object-oriented programming. Each module includes detailed explanations, examples, and programming tasks to reinforce learning. Key concepts include variable definitions, string methods, list and dictionary operations, and the use of modules like shutil and logging.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Introduction to Python programming (BPLCK205B/ 105B)

***Lab programs are most important***


MODULE - I

1. Explain how to evaluate an expression into the interactive shell with examples.
2. Explain different data types with an example.
3. Briefly explain string concatenation and replication with examples.
4. Define variables. Explain the different rules to define a variable with examples.
5. Explain print (), input (), len (), str (), int (), and float () functions with examples.
6. Explain Boolean values with examples.
7. Explain comparison and Boolean operators with examples.
8. Solve the following expression: 2+2==4 and not 2+2 == 5 and 2*2 == 2+2
9. Explain the different flow control statements with its flowchart and examples.
10. Explain the difference between break and continue statements with examples.
11. Explain the different arguments passed to the range () function with example.
12. Briefly explain how to import modules with examples.
13. Explain how to terminate program early with sys.exit() function with example.
14. Define function. Explain def statements with its parameters with example.
15. Explain briefly about return values and return statements with example.
16. Explain the different keyword arguments passed to the print() function.
17. Explain elif, for , while , break and continue statements in python with examples for
each and flowchart.
18. What is a function? How to define a function in python? How can we pass the parameters to the
user defined function explain with an example
19. List the rules to define a variable in python? What is local and global scope of variable in
Python. Explain the different scenarios with an example snippet.
20. How python handles the exception? Explain with an example program
21. Differentiate between parameters and arguments. Illustrate the flow of execution of a
python function with an example program
22. Demonstrate with an example len(), Int(), str() and Range()
23. List and explain operators used in python with a suitable example

MODULE – 2

1. Explain tuple data types with examples and Briefly explain how to convert types using list() and tuples()
functions.
2. Explain List data type with examples and Explain List concatenation and replication with examples.
3. Explain get() and setdefault() methods with examples.
4. Explain copy() and deepcopy() functions of copy module.
5. Explain nested dictionary with example.
6. Explain mutable and immutable data types with examples.
7. Explain append() and index() functions with respect to lists in Python.
8. Explain different ways to delete an element from a list with suitable Python syntax and programming
examples.
9. Explain keys(), values(), and items() methods of dictionaries with examples.
10. What are the different methods supports in python List. Illustrate any 3 methods with an example.
11. Demonstrate the working of tic-tac-toc board using Dictionaries
12. How tuples are created in python? Explain the different ways of accessing and creating
them
13. Discuss get(), Item(), values() and keys() dictionary methods in python with example
for each.
14. Explain (i) copy and deepcopy() (ii) passing references (iii) list Concatenation and
replication
15. Compare and contrast lists, tuples and dictionaries

MODULE – 3

1. Explain python string handling methods with examples: split(), endswith(), ljust(), center(), lstrip(), join(),
startswith(), rjust(), strip(), rstrip().
2. Explain with suitable python program segments: a) os.path.basename() b) os.path.join()
c) os.path.dirname() d) os.path.split().
3. Develop a python program to find the total size of all the files in the given directory.
4. Develop a python program to read and print the contents of a text file.
5. Explain the three steps for reading or writing files in python with examples.
6. Explain how to save variables using pprint.pformat() functions with suitable code snippet.
7. Explain the different functions for finding the size of a file and its folder contents with examples.
8. Explain indexing and slicing technique using strings with examples.
9. Explain string methods the upper(), lower(), isupper(), and islower().
10. List out all the useful string methods which supports in python. Explain with an example for each method.
12. What are the key properties of a file? Explain in detail file reading/writing process with an example of
python program
13. With code snippet, Explain saving variables using the shelve module and pprint pfromat() functions
14. Write an algorithm to implement password locker functionality
15. Develop a program to find total size of all the files in the directory
16. Discuss the different paths in the file system
17. Explain in briefly, what are the different methods of file operations supports in python shutil module.

MODULE – 4

1. Explain the different functions provided by the shutil module with examples.
2. Explain the different functions for permanently deleting files and folders with examples.
3. Briefly explain about os.walk function to walk through the entire directory tree with examples.
4. Explain send2trash module function with examples.
5. Explain how to read and extract the contents from Zip file using zipfile module with examples.
6. Explain the support for Logging with logging module in Python.
7. List and explain the logging levels in python
8. What is meant by compressing file? Explain creating,reading,extracting zip file with code snippet
9. Explain a role of assertions in python with a suitable example code
10. What is the use of ZIP? How to create a Zip folder explain.
11. Explain the functions with examples: (i) shutil.copytree (ii) shutil.move (iii) shutil.rmtree()
12. Explain the buttons in of IDLE Debugger window
MODULE – 5
1. Explain init and str method with an example python program
2. Explain program development concept ‘prototype & patch’ with suitable example.
3. Explain the following with syntax & code snippet
a) Class definition b) instantiation c) passing an instance (or objects) as an argument
d) instances as return values
4. Define polymorphism. Demonstrate polymorphism with function to find histogram
to count the numbers of times each letter appears in a word and in sentence
5. What is type based dispatch? Illustrate with python program.
6. What is a class? How to define class in python? How to initiate a class and how the
class members are accessed?
7. Demonstrate pure function and modifiers with examples.
8. Explain operator overloading and polymorphism with examples.
9. Write a function called print time that takes a time object and print it in the form

You might also like