SlideShare a Scribd company logo
1 of 47
1 | P a g e
ACADEMIC YEAR: 2021-22
Name : Yugen Jarwal
Class : XII-G
Roll No. : 40
School : Kendriya Vidyalaya No.1 A.F.S Gurgaon
2 | P a g e
INDEX
S
No.
AIM Date Page
No
Sign
1 Write a python program to
search an element in a list
and display the frequency
of elements present in the
list by using a user defined
function. [List and search
element should be
entered by user]
12.6.21 6
2 Write a python program to
search an element in a list
and print the location by
using a user defined
function. [List and search
element should be
entered by user]
12.6.21 8
3 Write a python program to
pass a list to a function
and double the odd values
and half even values of a
list and display list
elements after changing.
12.6.21 10
3 | P a g e
4 Write a Python program
input n numbers in tuple
and pass it to function to
count how many even and
odd numbers are entered.
23.6.21 12
5 Write a Python program to
pass a string to a function
and count how many
vowels present in the
string.
23.6.21 14
6 Write a Python program
to generate random
numbers between 1 and 6
(simulates a dice) using a
user defined function
5.7.21 16
7 Write a menu driven
python program to
implement 10 python
mathematical functions.
5.7.21 18
8 Write a python program
to implement any 05
python string functions
5.7.21 23
9 Write a menu driven
program in python to
delete the name of a
student from the
dictionary and to search
29.7.21
25
4 | P a g e
phone no of a student by
student name.
10 Write a python program to
read and display file
content line by line with
each word separated by #.
29.7.21 28
11 Write a python program
Read a text file and display
the number of vowels,
consonants, uppercase,
lowercase characters in
the file.
15.8.21 30
12 Write a python program to
create a binary file with
name and roll number.
Search for a given roll
number and display name,
if not found display
appropriate message.
15.8.21 32
13 Write a python program
to create a CSV file by
entering user-id and
password, read and search
the password for given
user-id.
16.8.21 35
14 Write a menu driven
python program to create
25.8.21 37
5 | P a g e
a CSV file by entering
dept-id, name and city,
read and search the record
for given dept-id.
15 Write a python program to
create a dictionary with
roll number, name and
marks. Accept 5 records
from the user and write
them into a binary file.
25.8.21 39
16 Write a Menu driven
program in python to
count spaces, digits, words
and lines from text file
TOY.txt
27.8.21 41
17 Write a python program to
remove all the lines that
contain the character ‘a’ in
a file and write it to
another file.
27.8.21 44
18 Write a Python program to
function with key and
value, and update value at
that key in the dictionary
entered by the user.
27.8.21 46
6 | P a g e
Practical – 1
Aim : Write a python program to search an element in a
list and displaythe frequency of elements present in
the list by using a user defined function. [List and
search element should be entered by user]
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
7 | P a g e
Output:
8 | P a g e
Practical – 2
Aim : Write a pythonprogram to search an element in a list
and print the locationby using a user defined
function. [List and search element should be entered
by user]
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
9 | P a g e
Output:
10 | P a g e
Practical – 3
Aim : Write a python program to pass a list to a function
and double the odd values and half even values of a
list and display list elements after changing.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
11 | P a g e
Output:
12 | P a g e
Practical – 4
Aim : Write a Python program input n numbersin tupleand
pass it to function to count how many even and odd
numbers are entered.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
13 | P a g e
Output:
14 | P a g e
Practical – 5
Aim : Write a Python program to pass a string to a function
and count how many vowels present in the string.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
15 | P a g e
Output:
16 | P a g e
Practical – 6
Aim : Write a Pythonprogram togenerate randomnumbers
between 1 and 6 (simulates a dice) using a user
defined function
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
17 | P a g e
Output:
18 | P a g e
Practical – 7
Aim : Write a menu driven python program to implement
10 pythonmathematical functions.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
P.T.O
19 | P a g e
20 | P a g e
21 | P a g e
22 | P a g e
Output:
23 | P a g e
Practical – 8
Aim : Write a python program to implement any 05
python string functions
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
24 | P a g e
Output:
25 | P a g e
Practical – 9
Aim : Write a menu driven program in python to delete
the name of a student from the dictionaryand to
search phone no of a student by student name.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
P.T.O
26 | P a g e
27 | P a g e
Output 1 :
Output 2:
28 | P a g e
Practical – 10
Aim : Write a python program to read and displayfile
content line by line with each word separated by #.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
29 | P a g e
Text File :
Output :
30 | P a g e
Practical – 11
Aim : Write a python program Read a text file and display
the number of vowels, consonants, uppercase,
lowercase characters in the file.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
31 | P a g e
Text File :
Output :
32 | P a g e
Practical – 12
Aim : Write a python program to create a binary file with
name and roll number. Search for a given roll
number and displayname, if not found display
appropriatemessage.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
P.T.O
33 | P a g e
34 | P a g e
Output:
35 | P a g e
Practical – 13
Aim : Write a python program to create a CSV file by
entering user-id and password, read and search the
password for given user-id.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
36 | P a g e
CSV file created :
Output :
37 | P a g e
Practical – 14
Aim : Write a menu driven python program to create a
CSV file by entering dept-id, name and city, read and
search the record for given dept-id.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
38 | P a g e
CSV file created :
Output:
39 | P a g e
Practical – 15
Aim : Write a python program to create a dictionarywith
roll number, name and marks. Accept 5 records
from the user and write them into a binary file.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
40 | P a g e
Output:
Binary File Created :
41 | P a g e
Practical – 16
Aim : Write a Menu driven program in pythonto count
spaces, digits, words and lines from text file TOY.txt
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
42 | P a g e
43 | P a g e
Output:
44 | P a g e
Practical – 17
Aim : Write a python program to remove all the lines that
containthe character ‘a’ in a file and write it to
another file.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
45 | P a g e
Output:
46 | P a g e
Practical – 18
Aim : Write a Python program to function with key and
value, and update value at that key in the
dictionaryentered by the user.
Software Used : Pycharm (Python 3.9 64-bit)
Hardware Used: Keyboard, Monitor, Mouse, Hard disc,
RAM
Code :
47 | P a g e
Output:

More Related Content

What's hot

Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)lokesh meena
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdfHarshitSachdeva17
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In PythonAbhishekKumarMorla
 
Physics Investigatory Project Class 12
Physics Investigatory Project Class 12Physics Investigatory Project Class 12
Physics Investigatory Project Class 12Self-employed
 
Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava adharshvg
 
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILK
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILKTO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILK
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILKAnkitSharma1903
 
Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)KushShah65
 
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)Anushka Rai
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THSHAJUS5
 
CLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOURCLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOURAryanNaglot
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
Physics activity file class 12
Physics activity file class 12Physics activity file class 12
Physics activity file class 12Titiksha Sharma
 
Project front page, index, certificate, and acknowledgement
Project front page, index, certificate, and acknowledgementProject front page, index, certificate, and acknowledgement
Project front page, index, certificate, and acknowledgementAnupam Narang
 
Chemistry Investigatory Project Class XII
Chemistry Investigatory Project Class XII Chemistry Investigatory Project Class XII
Chemistry Investigatory Project Class XII AsanalMahathir
 
Physics investigatory project for class 12
Physics investigatory project for class 12Physics investigatory project for class 12
Physics investigatory project for class 12Kavita Kulkarni
 
Chemistry project for Class 12
Chemistry project for Class 12Chemistry project for Class 12
Chemistry project for Class 12Shahban Ali
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Pythonvikram mahendra
 
Physics investigatory project on RECTIFIER
Physics investigatory project on RECTIFIERPhysics investigatory project on RECTIFIER
Physics investigatory project on RECTIFIERNaveen R
 
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILK
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILKPREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILK
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILKRajivSingh261
 
Rectifier class 12th physics investigatory project
Rectifier class 12th physics investigatory projectRectifier class 12th physics investigatory project
Rectifier class 12th physics investigatory projectndaashishk7781
 

What's hot (20)

Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In Python
 
Physics Investigatory Project Class 12
Physics Investigatory Project Class 12Physics Investigatory Project Class 12
Physics Investigatory Project Class 12
 
Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava Presence Of Oxalate Ions In Guava
Presence Of Oxalate Ions In Guava
 
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILK
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILKTO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILK
TO STUDY THE QUANTITY OF CASEIN PRESENT IN DIFFERENT SAMPLES OF MILK
 
Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)
 
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
 
CLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOURCLASS 12 ENGLISH PROJECT ON CHILD LABOUR
CLASS 12 ENGLISH PROJECT ON CHILD LABOUR
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
Physics activity file class 12
Physics activity file class 12Physics activity file class 12
Physics activity file class 12
 
Project front page, index, certificate, and acknowledgement
Project front page, index, certificate, and acknowledgementProject front page, index, certificate, and acknowledgement
Project front page, index, certificate, and acknowledgement
 
Chemistry Investigatory Project Class XII
Chemistry Investigatory Project Class XII Chemistry Investigatory Project Class XII
Chemistry Investigatory Project Class XII
 
Physics investigatory project for class 12
Physics investigatory project for class 12Physics investigatory project for class 12
Physics investigatory project for class 12
 
Chemistry project for Class 12
Chemistry project for Class 12Chemistry project for Class 12
Chemistry project for Class 12
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
 
Physics investigatory project on RECTIFIER
Physics investigatory project on RECTIFIERPhysics investigatory project on RECTIFIER
Physics investigatory project on RECTIFIER
 
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILK
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILKPREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILK
PREPARATION OF SOYBEAN MILK AND ITS COMPARISION WITH NATURAL MILK
 
Rectifier class 12th physics investigatory project
Rectifier class 12th physics investigatory projectRectifier class 12th physics investigatory project
Rectifier class 12th physics investigatory project
 

Similar to Python Functions and File Handling Practicals

UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON Nandakumar P
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfpython-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfKosmikTech1
 
Introduction to Python.pdf
Introduction to Python.pdfIntroduction to Python.pdf
Introduction to Python.pdfRahul Mogal
 
python presentation
python presentationpython presentation
python presentationVaibhavMawal
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdfsamiwaris2
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsjody zoll
 
Char word counter in Python with simple gui - PROJECT
Char word counter in Python with simple gui - PROJECTChar word counter in Python with simple gui - PROJECT
Char word counter in Python with simple gui - PROJECTMahmutKAMALAK
 
Enjoy Type Hints and its benefits
Enjoy Type Hints and its benefitsEnjoy Type Hints and its benefits
Enjoy Type Hints and its benefitsmasahitojp
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringscskvsmi44
 
Cis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and stringsCis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and stringsCIS321
 
Mastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMalcolmDupri
 
Python introduction towards data science
Python introduction towards data sciencePython introduction towards data science
Python introduction towards data sciencedeepak teja
 

Similar to Python Functions and File Handling Practicals (20)

UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
 
devyani.pptx
devyani.pptxdevyani.pptx
devyani.pptx
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfpython-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
 
Introduction to python3.pdf
Introduction to python3.pdfIntroduction to python3.pdf
Introduction to python3.pdf
 
Introduction to Python.pdf
Introduction to Python.pdfIntroduction to Python.pdf
Introduction to Python.pdf
 
python presentation
python presentationpython presentation
python presentation
 
Python Programming.pptx
Python Programming.pptxPython Programming.pptx
Python Programming.pptx
 
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 
Char word counter in Python with simple gui - PROJECT
Char word counter in Python with simple gui - PROJECTChar word counter in Python with simple gui - PROJECT
Char word counter in Python with simple gui - PROJECT
 
Enjoy Type Hints and its benefits
Enjoy Type Hints and its benefitsEnjoy Type Hints and its benefits
Enjoy Type Hints and its benefits
 
Python4.pptx
Python4.pptxPython4.pptx
Python4.pptx
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
 
Cis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and stringsCis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and strings
 
QR Code Generator.pdf
QR Code Generator.pdfQR Code Generator.pdf
QR Code Generator.pdf
 
Mastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions DemystifiedMastering the Interview: 50 Common Interview Questions Demystified
Mastering the Interview: 50 Common Interview Questions Demystified
 
Python introduction towards data science
Python introduction towards data sciencePython introduction towards data science
Python introduction towards data science
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

Python Functions and File Handling Practicals

  • 1. 1 | P a g e ACADEMIC YEAR: 2021-22 Name : Yugen Jarwal Class : XII-G Roll No. : 40 School : Kendriya Vidyalaya No.1 A.F.S Gurgaon
  • 2. 2 | P a g e INDEX S No. AIM Date Page No Sign 1 Write a python program to search an element in a list and display the frequency of elements present in the list by using a user defined function. [List and search element should be entered by user] 12.6.21 6 2 Write a python program to search an element in a list and print the location by using a user defined function. [List and search element should be entered by user] 12.6.21 8 3 Write a python program to pass a list to a function and double the odd values and half even values of a list and display list elements after changing. 12.6.21 10
  • 3. 3 | P a g e 4 Write a Python program input n numbers in tuple and pass it to function to count how many even and odd numbers are entered. 23.6.21 12 5 Write a Python program to pass a string to a function and count how many vowels present in the string. 23.6.21 14 6 Write a Python program to generate random numbers between 1 and 6 (simulates a dice) using a user defined function 5.7.21 16 7 Write a menu driven python program to implement 10 python mathematical functions. 5.7.21 18 8 Write a python program to implement any 05 python string functions 5.7.21 23 9 Write a menu driven program in python to delete the name of a student from the dictionary and to search 29.7.21 25
  • 4. 4 | P a g e phone no of a student by student name. 10 Write a python program to read and display file content line by line with each word separated by #. 29.7.21 28 11 Write a python program Read a text file and display the number of vowels, consonants, uppercase, lowercase characters in the file. 15.8.21 30 12 Write a python program to create a binary file with name and roll number. Search for a given roll number and display name, if not found display appropriate message. 15.8.21 32 13 Write a python program to create a CSV file by entering user-id and password, read and search the password for given user-id. 16.8.21 35 14 Write a menu driven python program to create 25.8.21 37
  • 5. 5 | P a g e a CSV file by entering dept-id, name and city, read and search the record for given dept-id. 15 Write a python program to create a dictionary with roll number, name and marks. Accept 5 records from the user and write them into a binary file. 25.8.21 39 16 Write a Menu driven program in python to count spaces, digits, words and lines from text file TOY.txt 27.8.21 41 17 Write a python program to remove all the lines that contain the character ‘a’ in a file and write it to another file. 27.8.21 44 18 Write a Python program to function with key and value, and update value at that key in the dictionary entered by the user. 27.8.21 46
  • 6. 6 | P a g e Practical – 1 Aim : Write a python program to search an element in a list and displaythe frequency of elements present in the list by using a user defined function. [List and search element should be entered by user] Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 7. 7 | P a g e Output:
  • 8. 8 | P a g e Practical – 2 Aim : Write a pythonprogram to search an element in a list and print the locationby using a user defined function. [List and search element should be entered by user] Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 9. 9 | P a g e Output:
  • 10. 10 | P a g e Practical – 3 Aim : Write a python program to pass a list to a function and double the odd values and half even values of a list and display list elements after changing. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 11. 11 | P a g e Output:
  • 12. 12 | P a g e Practical – 4 Aim : Write a Python program input n numbersin tupleand pass it to function to count how many even and odd numbers are entered. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 13. 13 | P a g e Output:
  • 14. 14 | P a g e Practical – 5 Aim : Write a Python program to pass a string to a function and count how many vowels present in the string. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 15. 15 | P a g e Output:
  • 16. 16 | P a g e Practical – 6 Aim : Write a Pythonprogram togenerate randomnumbers between 1 and 6 (simulates a dice) using a user defined function Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 17. 17 | P a g e Output:
  • 18. 18 | P a g e Practical – 7 Aim : Write a menu driven python program to implement 10 pythonmathematical functions. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code : P.T.O
  • 19. 19 | P a g e
  • 20. 20 | P a g e
  • 21. 21 | P a g e
  • 22. 22 | P a g e Output:
  • 23. 23 | P a g e Practical – 8 Aim : Write a python program to implement any 05 python string functions Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 24. 24 | P a g e Output:
  • 25. 25 | P a g e Practical – 9 Aim : Write a menu driven program in python to delete the name of a student from the dictionaryand to search phone no of a student by student name. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code : P.T.O
  • 26. 26 | P a g e
  • 27. 27 | P a g e Output 1 : Output 2:
  • 28. 28 | P a g e Practical – 10 Aim : Write a python program to read and displayfile content line by line with each word separated by #. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 29. 29 | P a g e Text File : Output :
  • 30. 30 | P a g e Practical – 11 Aim : Write a python program Read a text file and display the number of vowels, consonants, uppercase, lowercase characters in the file. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 31. 31 | P a g e Text File : Output :
  • 32. 32 | P a g e Practical – 12 Aim : Write a python program to create a binary file with name and roll number. Search for a given roll number and displayname, if not found display appropriatemessage. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code : P.T.O
  • 33. 33 | P a g e
  • 34. 34 | P a g e Output:
  • 35. 35 | P a g e Practical – 13 Aim : Write a python program to create a CSV file by entering user-id and password, read and search the password for given user-id. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 36. 36 | P a g e CSV file created : Output :
  • 37. 37 | P a g e Practical – 14 Aim : Write a menu driven python program to create a CSV file by entering dept-id, name and city, read and search the record for given dept-id. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 38. 38 | P a g e CSV file created : Output:
  • 39. 39 | P a g e Practical – 15 Aim : Write a python program to create a dictionarywith roll number, name and marks. Accept 5 records from the user and write them into a binary file. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 40. 40 | P a g e Output: Binary File Created :
  • 41. 41 | P a g e Practical – 16 Aim : Write a Menu driven program in pythonto count spaces, digits, words and lines from text file TOY.txt Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 42. 42 | P a g e
  • 43. 43 | P a g e Output:
  • 44. 44 | P a g e Practical – 17 Aim : Write a python program to remove all the lines that containthe character ‘a’ in a file and write it to another file. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 45. 45 | P a g e Output:
  • 46. 46 | P a g e Practical – 18 Aim : Write a Python program to function with key and value, and update value at that key in the dictionaryentered by the user. Software Used : Pycharm (Python 3.9 64-bit) Hardware Used: Keyboard, Monitor, Mouse, Hard disc, RAM Code :
  • 47. 47 | P a g e Output: