0% found this document useful (0 votes)
13 views3 pages

Pgggs

The document contains a Python script that reads and processes a text file, separating lines containing the letter 'a' into a second file. It also counts lowercase and uppercase letters, vowels, and consonants, and allows for data entry and retrieval using CSV format. The script features a menu for user interaction to write, read, and analyze student scores stored in a CSV file.

Uploaded by

prvns8980.drnkvv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Pgggs

The document contains a Python script that reads and processes a text file, separating lines containing the letter 'a' into a second file. It also counts lowercase and uppercase letters, vowels, and consonants, and allows for data entry and retrieval using CSV format. The script features a menu for user interaction to write, read, and analyze student scores stored in a CSV file.

Uploaded by

prvns8980.drnkvv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

def reada():

f=open(r'C:\Users\acer\Documents\iijkkk.txt',"r")
l=f.readline()
for i in l:
w=i.split()
for j in w:
print(j+'#')
f.close()
reada();
def tran():
f=open(r'C:\Users\acer\Documents\iijkkk.txt',"r")
l=f.readlines()
f.close()
f=open(r'C:\Users\acer\Documents\iijkkk.txt','w')
f2=open('secnd.txt','w')
for i in l:
if 'a' in i or 'A' in i:
f2.write(i)
else:
f.write(i)
f.close()
f2.close()
tran();
f=open('secnd.txt','r')
k=f.read()
v=0
c=0
l=0
u=0
for i in k:
if(i.islower()):
l+=1
elif(i.isupper()):
u+=1
i=i.lower()
if(i in ['a','e','i','o','u']):
v+=1
elif(i in
['b','c','d','f','g','h','j','d','f','k''l','m','n','p','q','r','s','t','v','w','x'
,'y','z']):
c+=1
f.close()
print('v',v)
print('c',c)
print('l',l)
print('u',u)
import pickle
s={}
l=[]
n=int(input('fuhi'))
for i in range(n):
s['r']=int(input('fuhi'))
s['k']=input('fuhi')
l.append(s)
s={}
f=open('secnd.txt','wb')
pickle.dump(l,f)
print('v')
f.close()
f=open('secnd.txt','rb')
l=pickle.load(f)
r=int(input('fuhi'))
p=False
for s in l:
if(s['r']==r):
p=True
print(s['k'],'found')
if(p==False):
print('noo')
f.close()
import csv
def writefile(f):
l=[]
w=csv.writer(f)
no=int(input('kjhgf'))
n=input('kjhgf')
s1=int(input('kjhgf'))
s2=int(input('kjhgf'))
s3=int(input('kjhgf'))
s4=int(input('kjhgf'))
s5=int(input('kjhgf'))
d=[s1,s2,s3,s4,s5]
w.writerow(d)
def readfile(f):
r=csv.reader(f)
for i in r:
print('nu,mb',i[0])
print('mname',i[1])
for j in range(2,7):
print('s',j-1,'m',i[j])
total=0
for j in range(2,7):
total=total+int(i[j])
print('total',total)
print('perce',total/5)
def read90(f):
r=csv.reader(f)
for i in r:
fl=False
for j in range(2,7):
if(int(i[j])>90):
fl=True
if(fl==True):
print('nu,mb',i[0])
print('mname',i[1])
for j in range(2,7):
print('s',j-1,'m',i[j])
f=open('secnd.txt','a+')
w=csv.writer(f)
w.writerow(['roll','name','s1','s2','s3','s4','s5'])
f.close()
while(1):
print('yyfhumomsdbgbb')
ch=int(input('kjhgf'))
if(ch==1):
f=open('secnd.txt','a+')
writefile(f)
f.close()
elif(ch==2):
f=open('secnd.txt','r')
f.seek(0,0)
readfile(f)
f.close()
elif(ch==3):
f=open('secnd.txt','r')
f.seek(0,0)
read90(f)
f.close()
elif(ch==4):
break
else:
print('thk u')

You might also like