Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech II PYTHON PROGRAMMING Previous Question Paper (September - 2021 - R18)

B.Tech | II | II-I | R18 | September - 2021

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

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Define a Variable and mention rules for choosing names of Variable.

5 marks

Answer

A variable is a reserved memory location used to store values within a program. In Python, variables are created when a value is assigned to them using the assignment operator (=).

Rules for naming variables:

  • Variable names must start with a letter or an underscore (_).
  • They cannot start with a number.
  • They can only contain alpha-numeric characters and underscores (A-z, 0-9, and _).
  • Variable names are case-sensitive (e.g., age, Age, and AGE are different variables).
  • They cannot be any of the Python keywords (e.g., if, while, def).
b

Discuss a various operations that can be performed on a tuple and lists with an example program.

10 marks

Answer

Lists and tuples are sequence data types in Python. A list is mutable (can be modified), whereas a tuple is immutable (cannot be changed after creation).

Common operations for both include indexing, slicing, concatenation, and repetition. Lists additionally support methods like append(), remove(), and pop().

# Example program my_list = [1, 2, 3] my_tuple = (4, 5, 6) # Accessing elements print(my_list[0]) # Output: 1 # Slicing print(my_tuple[1:]) # Output: (5, 6) # List modification (Mutable) my_list.append(4) print(my_list) # Output: [1, 2, 3, 4] # Concatenation combined = my_list + [5] print(combined) # Output: [1, 2, 3, 4, 5]
215 marks
a

What is an Exception? Explain types of exceptions and give an example.

7 marks

Answer

Sign in to view the complete answer paper.

b

Define Module. How many ways to import module in python? Explain with an example.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

What do you mean by Regular Expression? How to find whether an email id entered by the user is valid or not using Python ‘re’ module.

8 marks

Answer

Sign in to view the complete answer paper.

b

What is the motivation behind parallelism and state how python achieves parallelism?

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write a python program to develop a checkbox widget using Tkinter.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about building web applications using python’s CGI Module.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

List and explain various cursor classes in MySQLdb.cursors.

7 marks

Answer

Sign in to view the complete answer paper.

b

Define ORM. Why ORMs are useful? Explain.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Develop a python program to find the largest number among three numbers.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain the need for 'continue' and 'break' statements. Write a program to check whether a number is prime or not. Prompt the user for input.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Write a python program to print the sum of the following series: 1 + 1/2 + 1/3 + ... + 1/n.

6 marks

Answer

Sign in to view the complete answer paper.

b

Explain user defined exceptions in python.

5 marks

Answer

Sign in to view the complete answer paper.

c

What are the features of python?

4 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write a small code to illustrate packages in Python.

7 marks

Answer

Sign in to view the complete answer paper.

b

How do we achieve code reusability in python? Write a python code to Explain code reusability.

8 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 II-I, September - 2021, 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...