JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech IV Year PYTHON PROGRAMMING Previous Question Paper (February/March - 2022 - R18)
Answer any five questions. All questions carry equal marks.
Main
Does Python support multiple assignment? Justify your answer.
Answer
Yes, Python supports multiple assignment, which allows you to assign values to multiple variables in a single statement. This feature enhances code readability and conciseness.
For example, you can assign the same value to multiple variables using:
List the basic style guidelines of Python.
Answer
Python follows the PEP 8 style guide to ensure code consistency and readability. Key guidelines include:
- Use 4 spaces per indentation level, avoiding tabs.
- Limit all lines to a maximum of 79 characters.
- Use blank lines to separate functions and classes, and larger blocks of code inside functions.
- Imports should be placed at the top of the file, grouped by standard library, third-party, and local imports.
- Use spaces around operators and after commas, but avoid extraneous whitespace inside parentheses, brackets, or braces.
- Use snake_case for functions and variables, and PascalCase for class names.
- Include docstrings for public modules, functions, classes, and methods to explain their purpose.
- Avoid using single-character names like 'l', 'O', or 'I' to prevent confusion with numerals.
Discuss about complex numbers and operators for them.
Answer
Sign in to view the complete answer paper.
With the help of a flowchart discuss numeric coercion rules.
Answer
Sign in to view the complete answer paper.
Write a program to append the content of the first file to the second file. Read the file names as command line arguments.
Answer
Sign in to view the complete answer paper.
How to handle Zero Division Error? Explain with suitable code.
Answer
Sign in to view the complete answer paper.
What is a namespace? Compare it with variable scope, packages.
Answer
Sign in to view the complete answer paper.
Illustrate common regular expression symbols and special characters used in Python for string matching.
Answer
Sign in to view the complete answer paper.
How to access threads from Python?
Answer
Sign in to view the complete answer paper.
What is reentrant lock object? Discuss its use in a program.
Answer
Sign in to view the complete answer paper.
Write Python script to perform authentication for HTTP client request and explain working of your script.
Answer
Sign in to view the complete answer paper.
Write a Python program to access the bill details of a customer by accepting customer ID from user. Database table will have customer bill details along with customer ID.
Answer
Sign in to view the complete answer paper.