JNTU
JNTU B.Tech IV Year PYTHON PROGRAMMING Previous Question Paper (July/August - 2022 - R18)
Answer any five questions
All questions carry equal marks
Main
Describe the important features of Python.
Answer
Python is a high-level, interpreted, and general-purpose programming language known for its simplicity and versatility. Its key features include:
- Simple and Readable Syntax: Python uses indentation to define code blocks, making the code clean and easy to read compared to languages that use braces.
- Interpreted Language: Code is executed line-by-line, which simplifies debugging and testing.
- Dynamically Typed: Variable types are determined at runtime, so there is no need to declare variable types explicitly.
- Extensive Standard Library: It comes with a vast collection of modules and packages that support various tasks like file I/O, networking, and data manipulation.
- Cross-Platform Support: Python code can run on different operating systems like Windows, macOS, and Linux without modification.
- Object-Oriented and Procedural: It supports multiple programming paradigms, allowing developers to use object-oriented, procedural, or functional styles.
- Embeddable and Extensible: Python can be integrated with C or C++ code, and it can be embedded into other applications to provide scripting capabilities.
With examples illustrate augmented assignment and multiple assignment operators.
Answer
Assignment operators are used to assign values to variables. Augmented and multiple assignments provide concise ways to perform these operations.
Augmented Assignment Operators: These combine an arithmetic operation with an assignment. They are shorthand for updating a variable's value based on its current value.
x = 10
x += 5 # Equivalent to x = x + 5, now x is 15
x *= 2 # Equivalent to x = x * 2, now x is 30Multiple Assignment Operators: Python allows assigning values to multiple variables in a single statement. This is useful for swapping values or initializing several variables at once.
# Assigning multiple values
a, b, c = 1, 2, 3
# Swapping values
a, b = b, a # Now a is 2 and b is 1
# Assigning the same value to multiple variables
x = y = z = 100How does garbage collector work in Python?
Answer
Sign in to view the complete answer paper.
Differentiate between lists and tuples.
Answer
Sign in to view the complete answer paper.
How to unify integers and long integers?
Answer
Sign in to view the complete answer paper.
Illustrate the following file methods: readline, readlines, tell, seek.
Answer
Sign in to view the complete answer paper.
Write a program to append the content of first file to second file. Read two file names as command line arguments.
Answer
Sign in to view the complete answer paper.
How can programmers create their own exception classes in Python? Give example.
Answer
Sign in to view the complete answer paper.
What is a python module? Compare with functions.
Answer
Sign in to view the complete answer paper.
How do namespaces relate to variable scope?
Answer
Sign in to view the complete answer paper.
Does regular expression pattern enable matching of multiple strings? Justify your answer with illustrations.
Answer
Sign in to view the complete answer paper.
Describe the core functions and methods of re module of Python.
Answer
Sign in to view the complete answer paper.
Differentiate between process and thread. How to access threads from Python?
Answer
Sign in to view the complete answer paper.
Write a program to develop a multithreaded application using standard library modules related to threading.
Answer
Sign in to view the complete answer paper.
Discuss any eight Tk widgets used in GUI programming.
Answer
Sign in to view the complete answer paper.
What is a web crawler? Write Python code for a web crawler.
Answer
Sign in to view the complete answer paper.
Illustrate the use of DB-API module attributes.
Answer
Sign in to view the complete answer paper.
Make a comparison of the two well-known Python object relational managers – SQLAlchemy and SQLObject.
Answer
Sign in to view the complete answer paper.