0% found this document useful (0 votes)
29 views

ITWS Midsem 2 Part B

grcrfefc grgcecr rtcrcf rgcrc

Uploaded by

Pratik Raj
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)
29 views

ITWS Midsem 2 Part B

grcrfefc grgcecr rtcrcf rgcrc

Uploaded by

Pratik Raj
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/ 2

ITWS midsem 2 part b

QUES 1:Part B

f=open("avg.txt","w")

for i in range(10):
     f.write("%d\r\n" %int(input()))
f.close()
fh=open("avg.txt","w+")
sumi = 0
count = 0
for line in fh:
    count += 1
    sumi += float(f.readline())
average = sumi / count

fh.write(average)

OUTPUT:

QUES1:Part A

def Check_Vow(string, vowels):


     
    string = string.casefold()
    count = {}.fromkeys(vowels, 0)
     
    # To count the vowels
    for character in string:
        if character in count:
            count[character] += 1  
    return count
     
# Driver Code
vowels = 'e'
string = "azcbobobegghakl"
ITWS midsem 2 part b

print('Vowel with highest frequency is:')


print (Check_Vow(string, vowels))

OUTPUT:

You might also like