JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

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

B.Tech | II Year | I Semester | R18 | March - 2022

Answer PaperPaper Code: 153CDMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Summarize the built-in functions in Python with appropriate examples.

8 marks

Answer

Python provides a comprehensive set of built-in functions that are always available for use without needing to import any modules. These functions perform common tasks such as type conversion, mathematical operations, and sequence manipulation.

  • Type Conversion Functions: Used to change data types. Examples include
    int()
    ,
    float()
    ,
    str()
    , and
    list()
    . Example: int('10') converts a string to an integer.
  • Mathematical Functions: Functions like
    abs()
    (absolute value),
    max()
    (maximum value),
    min()
    (minimum value), and
    pow()
    (exponentiation). Example: max(1, 5, 3) returns 5.
  • Input/Output Functions:
    print()
    displays output to the console, while
    input()
    captures user input as a string.
  • Sequence/Collection Functions:
    len()
    returns the length of an object,
    sum()
    calculates the total of an iterable, and
    sorted()
    returns a new sorted list. Example: len([1, 2, 3]) returns 3.
  • Utility Functions:
    type()
    returns the data type of an object, and
    id()
    returns the unique memory address of an object.
b

Compare Lists and Tuples with an example.

7 marks

Answer

Lists and Tuples are both sequence data types in Python, but they differ significantly in mutability and performance.

FeatureListTuple
MutabilityMutable (can be modified)Immutable (cannot be modified)
SyntaxSquare brackets
[]
Parentheses
()
PerformanceSlowerFaster
MethodsMany (append, remove, pop)Few (count, index)

Example:

# List: Mutable
my_list = [1, 2, 3]
my_list[0] = 10  # Valid

# Tuple: Immutable
my_tuple = (1, 2, 3)
# my_tuple[0] = 10 # Raises TypeError
215 marks
a

List out and explain various types of operators used in Python.

7 marks

Answer

Sign in to view the complete answer paper.

b

Differentiate between List Slicing and List Mutability with examples.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

How to create a module? Give an example.

8 marks

Answer

Sign in to view the complete answer paper.

b

Illustrate how to handle an exceptions in python.

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

How to create a text file and write content in to the text file? Explain with a python script.

7 marks

Answer

Sign in to view the complete answer paper.

b

What are the various file opening modes in python?

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Discuss about various types of regular expressions in python.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write about Global Interpreter Lock.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Discuss about all the methods in Thread module.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a python script for Inter process communication.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

How to build a CGI application in Python?

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to demonstrate a group of check button widgets.

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write a python script to create a table, insert and display data from the database.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain various keys and constraints used in SQLite while creating relations.

7 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of PYTHON PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech ITE II Year I Semester, March - 2022, R18.

For the question paper without answers, switch to the Question Paper tab.

Other papers in PYTHON PROGRAMMING

Loading Question Papers

Fetching data from database...