Skip to content

14.Write a menu-driven Python program to develop a list of student names. The program should provide the following options: Add Student Insert Student at Position Remove Student Delete Student by Index Search Student Count Student Name Find Student Position Sort Student List Reverse Student List Copy Student List Clear Student List Display Student List Exit

ASSIGNMENT

Q.14

Q.2 Write a Python program to count the number of vowels and consonants in a string entered by the user. 

string = input("Enter a string: ") vowels = 0 consonants = 0 for ch in string: if ch.isalpha(): # Check if the character is an alphabet if ch.lower() in "aeiou": vowels += 1 else: consonants += 1 print("Number of Vowels:", vowels) print("Number of Consonants:", consonants)