You are on page 1of 3

Bharati Vidyapeeth English Medium School (CBSE)

Practical File Questions


1. Write function in Python to show use of all mathematical operations like addition,
subtraction, multiplication, division and modulus. Program should contain choices.
2. Write a Program to check if the entered number is Armstrong or not.
3. Write a function to count the number of digits in an integer without using a loop. Test it on
three input numbers.
4. Write a Python Program to enter age and print the eligibility to vote or not
(age>=60:"Eligible to Vote and happy retired life", age>=18: print("Eligible to Vote") ,
age<18: "Not Eligible to Vote"
5. Write a program to calculate simple interest using a function interest () that can receive
principal amount, time and rate and returns simple interest. Do specify default values for
rate and time as 10% and 2 years respectively.
6. Write function to accept two integers from the user and print a message saying if the first
number is divisible by second number or if it is not.
7. Write a python function to find factorial of the entered number.
8. Write a python function to enter a number and to print its table.
9. Function to find volume of box with default values Function should have following
parameters
length, width and height
10. Write a python function to show whether the entered number is prime or not.
11. Write a python function to enter the string and to check if it’s palindrome or not using loop
12. Write a Program to enter the numbers in a list and to show the greatest element using #loop
in the entered list.
13. Write a function that receives an octal number and prints equivalent number in decimal,
binary and hexadecimal equivalents.
14. Write a Program to enter the 5 subjects marks and print the grades A/B/C/D/E.
15. Write a method in python to read lines from a text file INDIA. TXT to find and display the
occurrences of the word ‘India’.
16. Write a Python program to take string with multiple words and then capitalize the first
letter of each word and forms a new string out of it.
17. Write a Python program to create first 9 terms of Fibonacci series.
18. Write definition of a method ZeroEnding(SCORES) to add all those values in the list of
SCORES,
which are ending with zero (0) and display the sum.
For example,
If the SCORES contain [200,456,300,100,234,678]
The sum should be displayed as 600
19. Write a Method AFIND(CITIES) to display all the city names from a list of CITIES, which are
starting with alphabet A.
For example:
If the list CITIES contains
["AHMEDABAD","CHENNAI","NEW DELHI","AMRITSAR","AGRA"]
The following should get displayed
AHEMDABAD
AMRITSAR
AGRA
20. Write a method to find and display the prime numbers between 2 to N. Pass N as an
argument.
21. Write definition of a method OddSum(NUMBERS) to add those values in the list of
NUMBERS, which are odd.
22. Write a python script to count the number of keys. (Use any of the dictionary methods to
count the key value pairs)
23. Write a python code to count the frequency of even numbers in a list and store the
frequency in a dictionary.
24. Write a Python function for use of arithmetic operation using multiple return statement.
25. Write a Python program for GCD and LCM of two integer number using the function.
26. Write Python script to create CSV file “user.csv” which will contain user name and password
for 5 entries.
27. Write a function Displaywords() in python to read lines from text file story.txt and display
those words which are less than 4 characters.
28. Write Python script to create DAT file “student.dat” which stores roll no, name and marks.
Get
data from user.
29. To read text file content “Answer.txt and display no. of vowels and consonants in the file.
30. Write a Python script to implement Stack as data structure.
31. Write a Python program to implement a stack for these book details (bookno, nook name).
Implement all methods and display stack.
32. Write a random number generator that generates random numbers between 1 and 6.
33. To read file and display records from student.dat whose marks<80.
34. Write Python mysql connectivity to insert record in employee table.
35. Write Python mysql connectivity to display record from employee table with row count.
36. Write Python mysql connectivity to update record from employee table set salary = 20000 of
all employee.
37. Write Python mysql connectivity to search record from employee table where age>30.
38. Write Python database connectivity Script that delete records from “Student” table of
database “STD” that have name = “Sujit”.
Consider the following tables GAMES and PLAYER and answer (b) and (c) parts of this
question:

Table: GAMES

GCode Game Name Type Number PrizeMoney ScheduleDate


101 Carom Board Indoor 2 5000 23-Jan-2004
102 Badminton Outdoor 2 12000 12-Dec-2003
103 Table Tennis Indoor 4 8000 14-Feb-2004
105 Chess Indoor 2 9000 01-Jan-2004
108 Lawn Tennis Outdoor 4 25000 19-Mar-2004

a. Write the SQL command to create table GAMES and add records in it.
b. Write the SQL command to display details of those GAMES which are having PrizeMoney
more than 7000.
c. Write the SQL command to display the content of the GAMES table in ascending order of
Schedule Date.
d. Write the SQL command to display sum of PrizeMoney for each type of GAMES.
e. Write sql command to update prize money by 500 whose number is greater than 2.

You might also like