JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech IV Year PYTHON PROGRAMMING Previous Question Paper (February/March - 2022 - R18)

B.Tech | IV Year | I Semester | R18 | February/March - 2022

Answer PaperPaper Code: 157EYMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Does Python support multiple assignment? Justify your answer.

7 marks

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:

x = y = z = 10
or assign different values to multiple variables simultaneously using tuple unpacking:
a, b, c = 1, 2, 3
. In the latter case, the number of variables on the left must match the number of elements on the right, or an error will occur.

b

List the basic style guidelines of Python.

8 marks

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.
215 marks
a

Discuss about complex numbers and operators for them.

8 marks

Answer

Sign in to view the complete answer paper.

b

With the help of a flowchart discuss numeric coercion rules.

7 marks

Answer

Sign in to view the complete answer paper.

3

Write a program to append the content of the first file to the second file. Read the file names as command line arguments.

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

How to handle Zero Division Error? Explain with suitable code.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is a namespace? Compare it with variable scope, packages.

8 marks

Answer

Sign in to view the complete answer paper.

5

Illustrate common regular expression symbols and special characters used in Python for string matching.

15 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

How to access threads from Python?

7 marks

Answer

Sign in to view the complete answer paper.

b

What is reentrant lock object? Discuss its use in a program.

8 marks

Answer

Sign in to view the complete answer paper.

7

Write Python script to perform authentication for HTTP client request and explain working of your script.

15 marks

Answer

Sign in to view the complete answer paper.

8

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.

15 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of PYTHON PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech CE IV Year I Semester, February/March - 2022, R18.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in PYTHON PROGRAMMING

Loading Question Papers

Fetching data from database...