Python Assignment: #Source Code
Python Assignment: #Source Code
#VRATTESH ANAND
#CLASS-12 SECTION-B
#ROLL NO:35
#Q8:
#SOURCE CODE:
def function_FIRST():
file1=open("Failaka.txt","r")
ST=file1.readlines()
print(len(ST))
file1.close()
def function_SECOND():
file2=open("Failaka.txt","r")
st1=file2.readlines()
c=0
for k in st1:
if k[0] in 'AEIOUaeiou':
c+=1
print(c)
file2.close()
def function_THIRD():
file3=open("Failaka.txt","r")
st1=file3.readlines()
c1=0
for k in st1:
if k[-1] not in "AEIOUaeiou":
c1+=1
print(c1)
file3.close()
def function_FOURTH():
file4=open("Failaka.txt","r")
st1=file4.read()
c2=0
c3=0
for k in st1:
if k.isalnum()==True:
c2+=1
print(c2,c3,end='')
file4.close()
def function_FIFTH():
file=open("FAILAKAUP.TXT","a")
file1=open("Failaka.txt","r")
st1=file1.readlines()
l=[]
for k in st1:
l+=k.upper()
st=file.writelines(l)
file.close()
file1.close()
while True:
print("=======================================================
===menu=======================================================
=====================================")
ch=int(input("enter A option"))
if ch==1:
function_FIRST()
elif ch==2:
function_SECOND()
elif ch==3:
function_THIRD()
elif ch==4:
function_FOURTH()
elif ch==5:
function_FIFTH()
elif ch==0:
print("breaking from menu")
break
else:
print('object not found , option not found')
#OUTPUT:
'''
Python 3.13.2 (tags/v3.13.2:4f8bb39, Feb 4 2025, 15:23:48)
[MSC v.1942 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more
information.