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

python important question

Bca Bangalore University 3rd sem

Uploaded by

bhuvaneshnair21
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)
450 views7 pages

python important question

Bca Bangalore University 3rd sem

Uploaded by

bhuvaneshnair21
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 - QUESTION BANK(Unit 1-4)

Unit 1

2 mark questions:

1. Define python
2. Who developed python?
3. What are the benefits of using python?
4. What is python interpreter?
5. What are the main features of python?
6. What is the use of indentation feature in Python?
7. Why Python is called an interpreted language?
8. What is the process of executing a python code?
9. List out the applications of python.
10. What is the purpose of type() function in Python.
11. Explain the difference between set and frozen set data types in Python.
12. What are mutable and immutable data types in Python.
13. What is type conversion in Python?
14. What is the function used to print output in Python?
15. What is % operator in string formatting in Python?
16. Give the difference between break and continue statement in Python.
17. Define function. List the types of functions in Python.
18. List out the advantages of functions.
19. What are built- in functions and user -defined functions.?
20. Give the syntax for defining a function.
21. What are void functions?
22. What are local and global variables?
23. Define module.
24. Give the difference between actual and formal parameters.
25. Define string.
26. What is slicing?
27. What is the purpose of join method?
5 / 8 Marks Questions:

1. Write the history of python.


2. Explain the concept of tokens in Python.
3. What are the rules for naming an identifier.
4. What are keywords? Explain with examples. .
5. What is a literal? Explain the different types of literals in Python with
examples.
6. Explain python variables in detail.
7. Explain the concept of declaring and assigning a variable in Python.
8. Explain the operators in Python.
9. Explain the use of statements and expression in Python.
10. What is the difference between "in" and "not in" membership operators in
Python?
11. What is the difference between "in" and "is" operators in Python?
12. Explain different types of data types in Python.
13. How can you convert string to integer in Python?
14. Explain comments in python and its purpose?
15. Discuss the importance of proper indentation in Python and how it affects
the code functionality?
16. Explain the different methods to accept input from the user in Python
with an example.
17. What is format() method and f-string in string formatting in Python.
18. Explain the various ways of string formatting in Python.
19. Why Python is called as dynamic typed language?
20. Explain the different types of control flow statements in Python with
examples.
21. Explain the different types of decision making control flow statements in
Python.
22. What is the use of nested if statements and python? Explain with
examples.
23. What is the difference between for loop and while loop?
24. Explain the types of if statements with suitable examples.
25. Explain the need for functions.
26. Explain the types of functions in python with suitable examples.
27. Explain max(), min(),len(), abs(), round(), pow(), sum(), eval() and exec()
functions with an example.
28. Explain the syntax of defining a function, function definition and calling
a function which is suitable example.
29. Explain passing arguments to functions with an example.
30. Explain void functions.
31. Explain keyboard arguments and Default arguments.
32. Write a note on lambda function.
33. Give the differences between modules, packages and Library in Python.
34. Discuss about command line arguments.
35. How strings are created and stored in Python?
36. Strings are immutable. Explain with an example.
37. How to access characters in a string by index numbers?
38. Explain the traversing of a string with the suitable example.
39. Explain basic string operations with an example.
40. Write a Python program to find the length of a string.
41. What is recursion? Explain with a suitable example.

Unit 2

2 mark questions:

1. Define a list, tuple, set and dictionary in Python.


2. What is a nested list?
3. What is aliasing?
4. How do you sort a list in Python?
5. How do you reverse a list in Python?
6. How do you remove duplicates from a list in Python?
7. How do you find the length of a list in Python?
8. How to create a dictionary using curly braces?
9. What is nested tuple? Give an example.
10. How to create a tuple using tuple() function?
11. Tuples are immutable. Give an example.
12. What is zip and unzip method in tuples?
13. How to delete a tuple?
14. How to create a set?
15. How to traverse a set?
16. What is frozenset?
17. What is tuple assignment?
Tuple assignment refers to the process of unpacking a tuple and assigning its elements to
individual variables. This allows you to simultaneously assign values to multiple variables in a
single statement.
my_tuple = (1, 2, 3)
a, b, c = my_tuple

18. What is tuple packing and unpacking?


Tuple Packing: This refers to the process of grouping multiple values into a tuple.

For example:
my_tuple = (1, 2, 3)
Tuple Unpacking: This refers to extracting the elements from a tuple and assigning
them to individual variables. For example:

a, b, c = my_tuple

5 / 8 Marks Questions:

1. Explain the concept of creating a list in Python with a suitable example.


2. Explain traversing a list in Python with the suitable example.
3. How to access list elements? Explain with an example.
4. Explain basic list operations.
5. Explain the features of a dictionary with advantages.
6. How to access key value pairs in a dictionary?
7. How membership operators in and not in works with the dictionary?
8. Explain del statement with an example.
9. How to add or modify key value pairs in a dictionary?
10. How to create a dictionary using dict() function?
11. Explain the concept of creating a dictionary.
12. How to create a tuple in Python? Write its syntax and give an example.
13. Explain basic tuple operations.
14. Explain the relation between tuple and lists.
15. Give the characteristics of a set.
16. Explain membership operators on a set.
17. Explain set methods.
18. Give the differences between list, tuple, set and dictionary.
Unit 3

2 mark questions:

1. Define a file.
2. What are the types of files?
3. Differentiate binary file and text file.
4. What is meant by absolute and relative file path?
5. What is the purpose of opening and closing a file?
6. Give the difference between tell() and seek() method in Python.
7. What are the attributes of a file object in Python?
8. What is pickle module in Python?
9. What is meant by pickling and unpickling in Python?
10. What is the CSV file in Python?
11. What is the difference between dump() and load()?
12. Define object oriented programming.
13. Define class and object in Python.
14. Define inheritance and polymorphism in OOP.
15. What is abstraction?
16. What is Duck typing in Python?
17. What are the access modifiers in Python?
18. Give the difference between class attributes and data attribute in Python.
19. What are the two types of polymorphism in Python?
20. Define Pandas and Data frames in Python.

5 / 8 Marks Questions:

1. Explain the file methods used to read data in Python.


2. Explain the file methods used to write data in Python.
3. Give the purpose of creating, reading and appending a text file in Python.
4. Explain pickle module in Python with advantages and disadvantages.
5. Discuss about CSV file / module in Python with the suitable example.
6. Explain the various file handling operations in Python with suitable
example.
7. Discuss the different methods for reading and writing to a CSV file using
the CSV module.
8. Explain how the csv.writer and csv.DictWriter methods work when
writing to a CSV file in Python.
9. How to append a text at a specific position in a file?
10. What are the features of object oriented programming?
11. Explain the basic concepts of object oriented programming.
12. Explain the concept of classes.
13. How to pass objects as arguments to a function? Explain
with an example.
14. Explain inheritance with suitable example.
15. Discuss polymorphism with the suitable example.
16. Discuss the different access modifiers in Python.
17. Explain the concept of Pandas and Data frames in Python with a
suitable example.
18. Explain Constructors with example
19. Explain Access modifiers with example
20. Explain function overloading and overriding with example
21. How to achieve data hiding in python?Explain
22. How to achieve encapsulation in python?Explain

Unit 4

2 marks questions:
1. What is data visualisation?
2. What is MATPLOTLIB?
3. What is JSON?
4. Mention any four methods of matplotlib library.
5. How to save a plot or a chart in matplotlib?
6. Mention different JSON formats.
7. Define Plotly.
8. What is an API and Web API?
9. What is API key?
10. What is GIT and GITHUB?

5 / 8 Marks Questions:

1. What are the different ways of generating data for data


visualisation in Python?
2. Explain the steps involved in data visualisation.
3. What are the advantages of data visualisation?
4. How to import data from csv files?
5. Explain the features of matplotlib.
6. How to plot a simple line graph using matplotlib? Explain
with simple program.
7. Explain the features for customising a graph.
8. Explain the types of graphs or charts.
9. What is random walk? Discuss in detail with a suitable example.
10. How to generate Random numbers? Write a program in
Python to generate Random numbers.
11. Define plotly. Mention the advantages of using plotly.
12. Give the differences between matplotlib and plotly.
13. Write a program to create a bar chart by reading data from
CSV files using matplotlib.
14. Explain the process of visualising data from a JSON file.
15. Write a program to create a scatter plot by reading data from
JSON file using plotly.
16. Discuss about Web API with advantages.
17. What is requests library? What are the features of it?
18. Explain the importance and advantages of GITHUB.
19. Write a Python program to access GITHUB API and
display the response.
20. Write a Python program to create a histogram to visualise python
projects on GITHUB.

You might also like