Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech II Year PYTHON PROGRAMMING Previous Question Paper (March - 2021 - R18)
Answer any five questions. All questions carry equal marks.
Main
Discuss the features of Python.
Answer
Python is a high-level, interpreted, and general-purpose programming language known for its simplicity and readability. Key features include:
- Simple and Readable: Python uses a clean syntax that emphasizes code readability, making it easy to learn and maintain.
- Interpreted: Code is executed line-by-line, which simplifies debugging and testing.
- Dynamically Typed: Variable types are determined at runtime, eliminating the need for explicit type declarations.
- Extensive Standard Library: It provides a vast collection of modules and functions for various tasks, such as file I/O, networking, and data manipulation.
- Cross-Platform: Python code can run on different operating systems like Windows, macOS, and Linux without modification.
What are the main differences between lists and tuples?
Answer
The primary differences between lists and tuples are:
| Feature | List | Tuple |
|---|---|---|
| Mutability | Mutable (can be modified) | Immutable (cannot be modified) |
| Syntax | Defined using square brackets [] | Defined using parentheses () |
| Performance | Slower due to dynamic nature | Faster due to fixed size |
| Methods | Supports many methods (append, remove, etc.) | Supports limited methods (count, index) |
Lists are ideal for collections of items that may change during program execution, whereas tuples are used for fixed data structures where integrity must be preserved.
Illustrate the use of None type.
Answer
Sign in to view the complete answer paper.
Categorize Python’s standard types.
Answer
Sign in to view the complete answer paper.
Python has five operational built-in functions for numeric types. Discuss them with examples.
Answer
Sign in to view the complete answer paper.
Explain the various access modes for File Objects.
Answer
Sign in to view the complete answer paper.
Write a program to prompt for a file name and display the number of lines in that text file.
Answer
Sign in to view the complete answer paper.
Differentiate between error and exception.
Answer
Sign in to view the complete answer paper.
Explain any four ways of use of raise statement.
Answer
Sign in to view the complete answer paper.
Compare compile, match, search functions of RE module.
Answer
Sign in to view the complete answer paper.
What are threads? How can they support parallel processing?
Answer
Sign in to view the complete answer paper.
Discuss the 15 types of widgets of Tk being used in Python for Graphical user interface programming.
Answer
Sign in to view the complete answer paper.
What is a URL? What is a URI? Describe the components of Web address.
Answer
Sign in to view the complete answer paper.
Compare and contrast CGI application with a typical Python script.
Answer
Sign in to view the complete answer paper.
What is a database? What DML commands are supported by Python?
Answer
Sign in to view the complete answer paper.
Discuss the steps to connect to MySQL database from Python.
Answer
Sign in to view the complete answer paper.