K Output Cropped

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

EX.

NO: 6
DATE:

CREATING A PYTHON PROGRAM TO READ A TEXT FILE LINE BY LINE AND


DISPLAY EACH WORD SEPARATED BY '#'

AIM:

To write a Python Program to Read a text file "Story.txt" line by line and display
each word separated by '#'.

SOURCE CODE:

Result:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
Story.txt:

***************************************************************************************
EX.NO: 7
DATE:

CREATING A PYTHON PROGRAM TO READ A TEXT FILE AND DISPLAY THE


NUMBER OF VOWELS/CONSONANTS/LOWER CASE/ UPPER CASE CHARACTERS.
AIM:
To write a Python Program to read a text file "Story.txt" and displays the number of
Vowels/ Consonants/ Lowercase / Uppercase/characters in the file.

SOURCE CODE:

Result:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
Story.txt:

***************************************************************************************
EX.NO:8
DATE:

CREATING A PYTHON PROGRAM TO COPY PARTICULAR LINES OF A TEXT FILE


INTO AN ANOTHER TEXT FILE

AIM:

To write a python program to read lines from a text file "Sample.txt" and copy those lines
into another file which are starting with an alphabet 'a' or 'A'.

SOURCE CODE:

Result:
Thus the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:

Python Executed Program output:


Sample.txt:

Python Executed Program Output:

New.txt:

*****************************************************************************************
EX.NO: 9
DATE:

CREATING A PYTHON PROGRAM TO CREATE AND SEARCH RECORDS IN


BINARY FILE

AIM:

To write a Python Program to Create a binary file with roll number and name.
Search for a given roll number and display the name, if not found display
appropriate message.

SOURCE CODE:

Result:
Thus , the above Python program is executed successfully and the output is verified.
SAMPLE OUPUT:

PYTHON PROGRAM EXECUTED OUTPUT:

*******************************************************************************************
EX.NO: 10
DATE:

CREATING A PYTHON PROGRAM TO CREATE AND UPDATE/MODIFY RECORDS IN


BINARY FILE
AIM:
To write a Python Program to Create a binary file with roll number, name, mark
and update/modify the mark for a given roll number.

SOURCE CODE:

Result:
SAMPLE OUTPUT:

PYTHON PROGRAM EXECUTED OUTPUT:

**********************************************************************************
EX.NO: 11
DATE:

CREATING A PYTHON PROGRAM TO CREATE AND SEARCHI EMPLOYEE’S RECORD


IN CSV FILE.

AIM:

To write a Python program Create a CSV file to store Empno, Name, Salary and
search any Empno and display Name, Salary and if not found display appropriate
message.
SOURCE CODE:

Result:

Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
PYTHON PROGRAM EXECUTED OUTPUT:

******************************************************************************
EX.NO: 12

DATE:

CREATING A PYTHON PROGRAM TO IMPLEMENT STACK OPERATIONS


AIM:
To write a Python program to implement Stack using a list data-structure.
SOURCE CODE:

Result:
SAMPLE OUTPUT:
Python Program Executed Output:
****************************************************************************************

You might also like