python exam questions
python exam questions
2. **Control Structures**
- If-else statements
- Loops (for, while)
- Break and continue statements
3. **Functions**
- Defining and calling functions
- Arguments and return values
- Lambda functions
4. **Data Structures**
- Lists, Tuples, Sets, Dictionaries
- Common methods (append, remove, pop, etc.)
5. **File Handling**
- Reading from and writing to files
- Using `with` statement for file operations
7. **Exception Handling**
- Try, except, finally
- Raising exceptions
8. **Object-Oriented Programming**
- Classes and Objects
- Inheritance and Polymorphism
- Constructors and Destructors
2. **Control Structures:**
- Write a program to print the Fibonacci series up to n terms using a loop.
3. **Functions:**
- Define a function that takes a list and returns the maximum and minimum
values.
4. **Data Structures:**
- Write a Python program to count the frequency of each element in a list.
5. **File Handling:**
- Write a program that reads a text file and counts the number of lines and
words in it.
6. **Exception Handling:**
- Write a program that takes user input and handles exceptions if the input is
not a number.
7. **OOP:**
- Create a class `Rectangle` with methods to calculate the area and perimeter.
Instantiate the class and display the results.
Here are some important theoretical questions related to Python programming that
could help you prepare for your BCA 3rd semester exam at MAKAUT:
1. **Data Types:**
- Explain the different data types in Python. How do they differ from each
other?
2. **Control Flow:**
- Describe the flow of execution in Python. What are conditional statements and
how are they used?
3. **Functions:**
- What are functions in Python? Explain the difference between a function with
parameters and a lambda function.
4. **Exception Handling:**
- Discuss the purpose of exception handling in Python. Explain the use of `try`,
`except`, `else`, and `finally` blocks.
5. **OOP Concepts:**
- Explain the four pillars of Object-Oriented Programming (OOP) and how they are
implemented in Python.
6. **File Handling:**
- What is file handling in Python? Discuss the different modes in which files
can be opened.
8. **Data Structures:**
- Compare and contrast lists, tuples, and dictionaries in Python. When would you
use each?
9. **List Comprehensions:**
- What are list comprehensions? Provide examples of how they can simplify code.
11. **Decorators:**
- What are decorators in Python? Explain how they can be used to modify the
behavior of functions.
12. **Generators:**
- What is a generator in Python? How does it differ from a regular function?
Here are some important theoretical questions that could be relevant for your BCA
3rd semester Python programming exam at MAKAUT:
2. **Control Structures:**
- Describe the use of conditional statements (if, elif, else) in Python. Provide
examples.
3. **Functions:**
- What are functions in Python? Discuss the difference between positional
arguments, keyword arguments, and default arguments.
4. **Exception Handling:**
- Explain the concept of exception handling in Python. How do `try`, `except`,
`else`, and `finally` work?
6. **File Handling:**
- What are the different modes for opening files in Python? Discuss reading from
and writing to files.
8. **Data Structures:**
- Compare and contrast lists, tuples, and dictionaries in Python. Discuss their
use cases.
9. **List Comprehensions:**
- What are list comprehensions? Provide examples and explain their advantages.
11. **Decorators:**
- What is a decorator in Python? Explain how decorators can be used to modify
function behavior.
12. **Generators:**
- What are generators in Python? Discuss how they are created and their
advantages over regular functions.
Here are some critical theoretical questions for your BCA 3rd semester Python
programming exam at MAKAUT:
1. **Python Basics:**
- What are the key features of Python? Discuss its advantages and disadvantages.
2. **Data Types:**
- Explain the built-in data types in Python. How do mutable and immutable types
differ?
3. **Control Flow:**
- Describe the structure and usage of if-else statements and loops (for, while)
in Python.
4. **Functions:**
- What is a function in Python? Explain the difference between a standard
function and a lambda function with examples.
5. **Exception Handling:**
- Explain the concept of exception handling. How do you use `try`, `except`,
`finally`, and `raise` in Python?
6. **Object-Oriented Programming:**
- Discuss the four pillars of OOP (Encapsulation, Inheritance, Polymorphism,
Abstraction) in Python with examples.
7. **File Handling:**
- What are the various modes to open a file in Python? Explain how to read from
and write to files.
9. **Data Structures:**
- Compare and contrast lists, tuples, and dictionaries. When would you choose
one over the others?
12. **Decorators:**
- What are decorators in Python? Provide an example of how to create and use a
decorator.
13. **Generators:**
- Define generators and discuss how they differ from normal functions. What are
their advantages?
1. **Python Fundamentals:**
- What is Python? Discuss its features and why it is popular for programming.
2. **Data Types:**
- Explain the different built-in data types in Python. Discuss the difference
between mutable and immutable data types.
3. **Control Structures:**
- Describe the use of if-else statements and loops (for, while) in Python.
Provide examples of each.
4. **Functions:**
- Define a function in Python. Explain the difference between positional and
keyword arguments with examples.
5. **Exception Handling:**
- What is exception handling? Explain the use of `try`, `except`, `finally`, and
`raise` in Python.
7. **File Handling:**
- Explain how to handle files in Python. What are the different modes for
opening a file, and how do you read/write data?
9. **Data Structures:**
- Compare and contrast lists, tuples, sets, and dictionaries in Python. When
would you use each?
12. **Decorators:**
- What are decorators in Python? Discuss their purpose and provide an example.
13. **Generators:**
- Define generators. How do they differ from regular functions, and what are
their benefits?
14. **Lambda Functions:**
- What is a lambda function in Python? Discuss its syntax and use cases.
Here’s a concise list of important theoretical questions for your BCA 3rd semester
Python programming exam at MAKAUT:
1. **Python Overview:**
- What is Python? Discuss its key features and advantages over other programming
languages.
2. **Data Types:**
- Explain the different built-in data types in Python (e.g., int, float, string,
list, tuple, dict). What are mutable and immutable types?
3. **Control Flow:**
- Describe the structure and purpose of conditional statements (if, elif, else)
and loops (for, while). Provide examples.
4. **Functions:**
- Define a function in Python. What are the differences between positional
arguments, keyword arguments, and default arguments?
5. **Exception Handling:**
- Explain the concept of exception handling in Python. Describe the use of
`try`, `except`, `finally`, and `raise`.
6. **Object-Oriented Programming:**
- Discuss the principles of OOP: Encapsulation, Inheritance, Polymorphism, and
Abstraction. Provide Python examples for each.
7. **File Handling:**
- What are the different modes for opening files in Python? Explain how to read
from and write to files.
9. **Data Structures:**
- Compare lists, tuples, sets, and dictionaries in Python. Discuss their use
cases and differences.
12. **Decorators:**
- What are decorators in Python? Discuss how they modify the behavior of
functions with examples.
13. **Generators:**
- Define generators. How do they differ from normal functions, and what are
their advantages?
Here are some crucial theoretical questions for your BCA 3rd semester Python
programming exam at MAKAUT:
2. **Data Types:**
- Explain the various built-in data types in Python. What is the difference
between mutable and immutable data types?
3. **Control Structures:**
- Describe the syntax and usage of conditional statements (if, elif, else) and
loops (for, while) in Python.
4. **Functions:**
- What is a function? Explain the differences between regular functions and
lambda functions, with examples.
5. **Exception Handling:**
- What is exception handling? Discuss the role of `try`, `except`, `finally`,
and how to raise exceptions in Python.
7. **File Handling:**
- Discuss how to handle files in Python. What are the different modes for
opening a file, and how do you read from and write to files?
9. **Data Structures:**
- Compare and contrast lists, tuples, sets, and dictionaries. Discuss their
characteristics and use cases.
12. **Decorators:**
- Define decorators in Python. How do they work, and provide an example of
their usage.
13. **Generators:**
- What are generators? Discuss how they differ from regular functions and their
advantages.