Index Python
Index Python
(1A)
468
10 12 14 16 18
9. Explain the use of pass and else keywords with for loops in Python. (1K)
12. Write a Python Program to find the factorial of a number provided by the user. (1M)
18. Write Python code for finding the greatest among four numbers (2B)
25. Explain different functions or ways to remove a key-value pair from a dictionary. (2G)
27. List and explain any four built-in functions on sets. (2I)
28. Write down the output of the following Python code: python indices = ['zero', 'one', 'two',
'three', 'four', 'five'] i) indices[:4] ii) indices[:-2] (2K)
29. Explain creating a dictionary and accessing dictionary elements with an example. (2K)
30. Explain any four Python built-in functions with examples. (2L)
31. Write a python program to input any two tuples and interchange the tuple variables. (2N)
33. Write a Python program to accept values from the user in a list and find the largest and
smallest numbers in the list. (2O)
40. Write a Python program to perform the following operations on a set: (3F)
46. Explain four built-in tuple functions in Python with examples. (3I)
49. Write a Python program to calculate sum of digit of given number using function. (1A)
51. What are local and global variables? Explain with an appropriate example. (3P)
54. Write a program for importing a module for addition and subtraction of two numbers. (1A)
55. Explain the use of the format() method with an example. (3R)
56. Write a program illustrating use of user defined package in python (3R)
58. Define the concept of data hiding. Write two advantages of data hiding. (3T)
60. Write a program to create a class Student with roll number and name and display its
contents. (4B)
62. With a neat example, explain the default constructor concept in Python. (4C)
64. Design a class Student with data members: name, roll number, department, and mobile
number. Create suitable methods for reading and printing student information. (4D)
67. What is a command-line argument? Write Python code to add two numbers given as input
from command-line arguments and print their sum. (4F)
68. Create a parent class named Animal and a child class Herbivorous that extends the
class Animal. Override the method feed() in the child class. Create an object. (4G)
70. Write a program to create a class EMPLOYEE with ID and NAME and display its contents. (4H)
72. State the use of read() and readline() functions in Python file handling. (4H)
73. Describe various modes of file objects. Explain any two in detail. (4I)
74. Explain seek() and tell() functions for file pointer manipulation in Python with examples. (4J)
75. WAP to read contents of first.txt file and write same content in second.txt file (4J)
76. With neat example differentiate between readline () and readlines () functions in file-
handling. (4K)
79. Explain how try-catch block is used for exception handling in python (4L)
80. Write python code to count frequency of each characters in a given file (4M)
81. Write python program to read contents of abc.txt and write same content to pqr.txt (4N)