0% found this document useful (0 votes)
147 views8 pages

Sarthak Arora

The document outlines several programming tasks including removing lines containing a character from a file, counting characters in a text file, creating a binary file to search for a roll number, generating random numbers between 1 and 6, implementing a stack using a list, reading a text file and displaying words separated by a character, and integrating SQL with Python by importing the MYSQL module.

Uploaded by

sarthak arora
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)
147 views8 pages

Sarthak Arora

The document outlines several programming tasks including removing lines containing a character from a file, counting characters in a text file, creating a binary file to search for a roll number, generating random numbers between 1 and 6, implementing a stack using a list, reading a text file and displaying words separated by a character, and integrating SQL with Python by importing the MYSQL module.

Uploaded by

sarthak arora
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

 Remove all the lines that contain the character “a” in a file and

write it into another file.

Assume we have the following file, located in the same folder as


Python:

INPUT-

OUTPUT-
 Read a text
file and
display the
number of
vowels/cons
onants/uppe
rcase/lower
case
characters
in the file.

Actual text
file

INPUT-
 Create a binary file with name and roll no. Search for a given
roll number and display the name, if not found display
appropriate message.
INPUT-

OUTPUT-
 Write a
random
number
generator
that
generates
random
numbers

between 1
and
6(simulates
a dice)

INPUT-

OUTPUT-
 Write a
program to
implement
a stack
using list
data
structure
INPUT-

OUTPUT-
 Read a
text file
line by
line
and
display
each
word
separat
ed by
a#
INPUT

OUTP
UT-
 Integrate
SQL with
python by
importing
MYSQL
module
 Integrate
SQL with
python by
importing
MYSQL
module.

You might also like