0% found this document useful (0 votes)
35 views

Pythonquestionbank

Uploaded by

A random girl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Pythonquestionbank

Uploaded by

A random girl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Unit -1

1.What is python ?what are the Uses of python ?


2.Define Variables.
3.What is Function?
4. Write a python program to find the length of the given
string.
5.List out the Advantages of In-Build functions
6.Write a python program to find the given character present
or not.
7.What is Recursion? And write any two applications.
8.What is error detection?
9.List out the uses of functions.
10.Define Expressions.
11.Write a python program to find the sum of the digits of a
number.
12.Write a Python program to Find the size of a Tuple.
(Big Questions)
1. Write a python function to calculate the factorial of a
number(a non-negative integer).the functions accepts the
number as an arguments
2. Write a python function to calculate the Fibonacci series.
3. How do you solve the problem of Tower of Hanoi
4. Write a Recursive function that accepts a number as its
argument and returns the sum of digits.
5. Write any five in-build function in string with example.
6. How do you reverse a message in python?
7. How do you find the length of a string without using
any-build in function?

Unit-2
1. Write short note on Boolean data type
2. List out the types of modules
3. Define class
4. Define Nested if statement.
5. What is methods?
6. Define Build-in modules
7. What are uses of user defind modules?
8. Define object oriented way.
9. Define Boolean expression Evalution
10.What is constructor?
11.Write a Python program to Find Sum of tuple elements
12.Differentiate while loop and for loop.
13. Write a python program to find area of a circle.
14. What is a pass in Python?
(Big Questions)
1. Write a python program to check if a year is leap year or
Not by using (Nested if)
2. Write a python program to find the maximum of three
numbers by using (Nested if)
3. Write a python program to remembering the results
Boolean Expression Evalution.
4. Write a python program calling methods the Object-
Oriented Way and Write any two examples
5. Write short note on modules.
i)Build-in modules.(math,date&time)
ii)User -defind modules(any 2 examples)
6.Explain details about constructor and write any two
examples.
7.Differentiate method and function.
8.Write a program to Check if a Number is Prime or not
9. Differentiate between List and Tuple?
10. An e-commerce company plans to give their customers a
discount
for the New Years holiday. The discount will be calculated on
the basis of the bill amount of the order placed. The discount
amount is the sum of all the odd digits ion the customer’s total
bill amount. If no odd digit is present in the bill amount, then
the discount will be zero.Write an algorithm to find the
discount for the given total bill amount.
Input
The input consists of an integer bill Amount, representing the
customer’s total bill amount.
Output
Print an integer representing the discount for the given total
bill
Amount
Input:
2514795
Output
27

Unit-3
1. What is looping ?Given Example.
2. Brief the advantages of list
3. What will be the output of the following python code?
i=1
while True:
if i%3 == 0:
break
print(i)
i+=1
4. What will be the ouput of the following python code
for i in range[1,2,3,4][::-1]:
print(i,end= “ ” )
5.Define Nested looping.
6.Write a Python program to Find Sum of tuple elements
7. What is a pass in Python?
8. Write a program to find the middle element in the
dictionary.
(Big Questions)
1. ).Given a list of Numbers analyze both of the searching
Linear and binary search.
2. Write a python program to sort a list of integers in
Ascending order using selection sort algorithm.
Input:
[11,9,5,6,1]
Output:
[1,5,6,9,11]
3. Write a python program to find the second largest and
Second smallest elements in the list
4.Write a python program to find sum of all elements in list.
5.Write a python Program to Swap Two Elements in a List.
Input : List = [23, 65, 19, 90], pos1 = 1, pos2 = 3
Output : [19, 65, 23, 90]

6.Write a python program to find the second largest and


Second smallest elements in set without using predefined
function.
7.Python code to verify every odd index in a list contains odd
number and Even Index contains Even number.
Sample Input:
21436763
Sample Output:
True
8. Write a python program to search for a given pattern
INPUT:
Mumbai Tamilnadu Erode Chennai Coimbatore
tamil
OUTPUT:
Tamilnadu
UNIT 4
1. What is file handling in Python?
2. Explain the different modes of opening a file in Python.
3. How do you create a text file using Python?
4. How do you read and write to an existing file in Python?
5. Is it possible to open multiple files using Python? If yes,
how?
6. How should you handle exceptions when dealing with
files in Python?
7. What Is the Difference Between == and is?
(Big Questions)
1.Demonstrate use of Dictionaries in python program.
2.Write script to work like a SQL SELECT statement for
internal data structure made in earlier exercise.
3.Write script to work like a SQL inner join for an internal
data structure made in earlier exercise.
4.Demonstrate collections in python.

UNIT 5

1. What are the different Return Types Used by Controller


Action Methods in MVC?
2. Assembly Where the MVC Framework Is Typically
Defined:
3. What is OOP, and why is it important
4. Explain the concepts of classes and objects in Python.
5. What design patterns do you typically use when building
desktop GUI applications?
6. How are events handled in Tkinter?
7. What are the advantages of using Tkinter?

(Big Questions)

1. Explain Model, View, and Controller


2. Demonstrate Exceptions in python.
3. What are Widgets in Tkinter? Give an Example to
creating a simple button in Tkinter.
4. Write short note on Building a Basic GUI,models,views.
5. Write a python to fill the employee details of BPS
company in a database read the employee details by
creating a employee class and object.

You might also like