Python Question Bank-BCCA SEM6
Python Question Bank-BCCA SEM6
2 Marks Questions
UNIT -I
1. What is Python?
2. What is comment? Give an example.
3. What are the supported data types in Python?
4. List any 8 keywords of python.
5. Define lists in Python.
6. What is negative index in Python?
7. How you can convert a number to a string?
8. What are the built-in types available in Python?
9. What is a string in Python?
10. What is keyword? List any 4 keywords in Python.
11. What is Assignment operator in Python? Give example.
12. How will you print multiple fields using print()?
13. What is the role of ** operator in Python.
14. Write down the syntax of while loop
15. Write down the syntax of for loop
1
UNIT-III (2 Marks Questions)
1. What is an acronym for ASCII?
2. What is class?
3. What is mean by class attribute?
4. How can class members be referenced?
5. Define encapsulation.
6. What is polymorphism?
7. What is inheritance?
8. How will you declare a class in python?
9. What is instance variable in python?
10. What is class variable?
2
3 Marks Questions
UNIT-I
3
UNIT-III (3 Marks Questions)
1. What is the purpose of encode() and decode() method.
2. How will you add, update or delete an attribute of class instance without using in-built functions.
3. What in-built functions are used to add, modify or remove an attribute of an instance?
4. Define method overriding.
5. What is DocString?
6. What is the purpose of built-in dir() function.
7. Explain file opening modes in Python.
8. Describe the file object properties.
9. What is the role of __init__() method.
10. What are the contents of __builtins__ modules?
5 Marks Questions
UNIT-I
4
UNIT-II (5 Marks Questions)
1. How will you create custom function in python? Explain with example
2. Write a program that will return factorial of given number.
3. Write a custom function to input any 3 numbers and find out the largest one.
4. Write a custom function to calculate x raise to power y.
5. What is mean by lambda expression? Explain
6. Write a program to generate Fibonacci series using yield keyword.
7. How will you invoke inbuilt exception explicitly? Explain with example
8. What is the difference between assert and exception.
9. What is function? Describe any four mathematical functions in Python.
10. How will you generate random numbers? Explain with example
11. List the date time directives with meaning.
12. Write a program to generate numbers from 10 to 1 at the intervals of 1 second.
13. Explain the metacharacters used for pattern matching with example.
1. Create a new HTML document containing a form with two text fields and a submit button.
2. Write a program to create entry widget in python.
3. Write a program to create list box in python.
4. Write a program to demonstrate click event of button.
5. Write a program to generate random number in the range of 1 to 10.
6. Create a new HTML document containing a form with a text area field and a submit button.
7. Create a new HTML document containing a form with one group of three radio buttons and
a submit button.
8. Create a new HTML document containing a form with a drop-down options list and
a submit button.
9. Describe three geometry manager methods.
10. Describe five arguments to a Checkbutton() constructor
5
10 Marks Questions
UNIT-I
1. How to install python on window?
2. How to install python on Linux?
3. Define any 10 methods used for manipulating List.
4. What is the difference between while and for loop? explain.
5. What is module and package in Python? Explain with example
6. How python interpreter can be used to perform different arithmetic calculation? explain
7. Explain various types of operators in python.
8. What is type casting? Explain in detail
9. What binary operators of python.
10. What is list, tuple,set and dictionary. Explain with example
6
UNIT-III (10 Marks Questions)
1. Define any 10 string modification methods.
2. What is pickling and unpickling? Explain with example.
3. What is inheritance? Explain with example.
4. What is mean by method overriding? Explain with example.
5. What is polymorphism ? Explain with example.
6. Explain the garbage collection system of python with example.
7. Write a program to demonstrate write and read file operation.
8. Describe any five file handling methods.
9. Write short note on string formatting in python.
10. Write short note on converting string in python.