0% found this document useful (0 votes)
6 views33 pages

Python Programming Tasks for Students

Uploaded by

james035210
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)
6 views33 pages

Python Programming Tasks for Students

Uploaded by

james035210
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

BVM PUBLIC

SCHOOL

PROGRAM FILE
SUBMITTED BY: HIMANSHU
ROHILLA
CLASS: XII G (NON-MEDICAL)
ADMISSION NO. : 2160
SUBMITTED TO : MR. GAURAV
SHARMA

Program Index
Q1. Write a python Function to sort a given list from
bubble sort method.

Q2. Write a python program to input string and count


the number of uppercase and lowercase letters.

Q3. Write a python program that creates a tuple


storing first 15 terms of fabonacci series.

Q4. Write a python function in pythonconvert() to


replace element having even values with its half and
element having odd values with twice its value in a list.

Q5. Write a python program to count the exact number


of records present in the csv file excluding the header.

Q6. Write a method in python to read lines from text


file”[Link]” and display those lines which start with
the alphabet ‘P’.

Q7. Write a method to count the words ‘to’ and ‘the’


present in text file’[Link]’.

Q8 Write a python program that reads data from a text


file and store all the uppercase and lowercase
character in different text file.
Q9. Write a python program to find the Armstrong of a
number.

Q10 Write a method write1() in python to write


multiple lines of text into text file ‘daynote .txt’.

Q11. Write a function Displaywords() in python to read


line from text file “[Link]” and display those words
which are less than 4 character.

Q12. Write a python program to display unique vowel


present in given word using stack.

Q13. Write a python Function in python PUSH(Arr),


where Arr is a list of number. From the list push all
number divisible by 5 into a stack implemted by list.

Q14. ABC School is managing student data in student


in the school database. Write a python code that
connects to database school and display the record of
total no. of students.

Q15. Write a program to insert employee no. , name


and salary data in binary file and show the records of
employees having salary between 20000 to 40000.

[Link] a python function to a student percentage


in binary file and display the inserted data.

Q17. To delete the record of a student on the basis of


name fetched from the user at run-time.

Q18. Write a python program that accepts a list of


numbers and numeric values by which all elements of
the list are shifted to the left.
Q19. Write a program to print the longest line along
with its length from collection of lines.

Q20. Write a python code to find out the size of a file in


bytes, number of lines and number of words.
Q1. Write a python Function to sort a
given list from bubble sort method.
CODE:-

OUTPUT:-
Q2. Write a python program to input
string and count the number of
uppercase and lowercase letters.
CODE:-

OUTPUT:-
Q3 Write a python program that creates
a tuple storing first 15 terms of
fabonacci series.
CODE:-

OUTPUT:-
Q4 Write a python function in
pythonconvert() to replace element
having even values with its half and
element having odd values with twice its
value in a list.
CODE:-

OUTPUT:-
Q5. Write a python program to count the
exact number of records present in the
csv file excluding the header.
CODE:-

OUTPUT:-
Q6. Write a method in python to read
lines from text file”[Link]” and display
those lines which start with the alphabet
‘P’.
CODE:-

OUTPUT:-
Q7 Write a method to count the words
‘to’ and ‘the’ present in text
file’[Link]’.
CODE:-
OUTPUT:-

Q8 Write a python program that reads


data from a text file and store all the
uppercase and lowercase character in
different text file.
CODE:-

OUTPUT:-
Q9. Write a python program to find the
Armstrong of a number.
CODE:-

OUTPUT:-
Q10 Write a method write1() in python to
write multiple lines of text into text file
‘daynote .txt’.
CODE:-

OUTPUT:-
Q11. Write a function Displaywords() in
python to read line from text file
“[Link]” and display those words
which are less than 4 character.
CODE:-

OUTPUT:-
Q12. Write a python program to display
unique vowel present in given word using
stack.
CODE:-

OUTPUT:-
Q13. Write a python Function in python
PUSH(Arr), where Arr is a list of number.
From the list push all number divisible
by 5 into a stack implemted by using a
list.
CODE:-

OUTPUT:-
Q14. ABC School is managing student
data in student in the school database.
Write a python code that connects to
database school and display the record of
total no. of students.
CODE:-
OUTPUT:-

Q15. Write a program to insert employee


no. , name and salary data in binary file
and show the records of employees
having salary between 20000 to 40000.
CODE:-
OUTPUT:-

[Link] a python function to a


student percentage in binary file and
display the inserted data.
CODE:-
OUTPUT:-
Q17. To delete the record of a student on
the basis of name fetched from the user
at run-time.
CODE:-

OUTPUT:-
Q18. Write a python program that
accepts a list of numbers and numeric
values by which all elements of the list
are shifted to the left.
CODE:-

OUTPUT:-
Q19. Write a program to print the
longest line along with its length from
collection of lines.
CODE:-

OUTPUT:-
Q20. Write a python code to find out the
size of a file in bytes, number of lines and
number of words.
CODE:-

OUTPUT:-
MY SQL
1. Student
2. Books
1) SQL Queries on
“Student”.
2) SQL Queries on “Books”.

You might also like