Class XII Computer Science Practical File
PRACTICAL 1: Number of vowels in a given string
str1 = input("Enter the line: ")
count = 0
for i in str1:
if i in 'aeiouAEIOU':
count += 1
print("Number of vowels:", count)
PRACTICAL 2: Words starting with a vowel
str1 = input("Enter the line: ")
count = 0
words = [Link]()
for i in words:
if i[0] in 'aeiouAEIOU':
count += 1
print("Number of words starting with vowel:", count)
PRACTICAL 3: Uppercase, lowercase, digits
line = input("Enter the value: ")
lcount = ucount = dcount = schar = 0
for i in line:
if [Link]():
lcount += 1
elif [Link]():
ucount += 1
elif [Link]():
dcount += 1
else:
schar += 1
print("Alphabets:", lcount + ucount)
print("Lowercase:", lcount)
print("Uppercase:", ucount)
print("Digits:", dcount)
print("Special characters:", schar)