Question Bank:
Q1. Define a Term:
a) Grid()
b) Exception.
c) Exception types.
d) range()
e) break and continue.
f) Tuple
g) Module
h) List
i) Dictionary
j) curselection()
k) get()
l) input()
m) Type casting
n) Raise
o) Try…except
p) Pass
q) Import
r) Int()
s) Float()
t) Tk() class
u) Geometry()
v) config()
w) finally
Q2. Answer the following: (with function without function)
a) Write a Python program to accept the details of student (RollNo, Name, Per ) and
display it using messagebox(). (Use tkinter module)
b) Write a Python program to check whether given number is prime or not. (Use
function)
c). Write a Python program using math module for the following:
1. To calculate the factorial of a number
2. To calculate b power of a. (ab)
3. To find GCD of two numbers
4. To find square root of a given number
5. To find LCM of two numbers.
d) Write a Python program to accept a number from user, if it is ‘0’ then throw user defined
exception “Number is Zero” otherwise ……for all programs.
e) Write a Python program to check whether given string is palindrome or not.
f) Write a Python program to calculate factorial of a number.
g) Write a Python program to calculate the sum of digits of a number.
h) Write a Python program to check whether given number is Armstrong or not.
i) Write a Python program to calculate the sum of first and last digits of a number
j) Write a Python program to check whether given number is perfect or not.
k) Write a Python program to calculate the sum of any ‘N’ numbers.
l) Write a Python program to reverse a given number.
m) Write a Menu driven program on List
n) Write a Python program to accept a string and perform following operations on it:
1. Reverse
2. Length
3. Slicing
4. Indexing
Please read the programs from notebook also.
Q3. Answer the following:
a. Differentiate between List and Set.
b. What is String? Explain any four methods of String with an example.
c. Explain the features of Python.
d. What is module? Explain anyone with an example.
e. What is Exception? Explain any two exceptions with an example
f. Explain Different types of operators with an example.
g. Explain execution process of python program.
h. Explain different types of widgets with an example.