Ge Python
Ge Python
string = input("Enter the string : ") vowels = ['a', 'e', 'i', 'o',
'u', 'A', 'E',
'I', 'O', 'U'] result = "" for i in range(len(string)): if
string[i] not in vowels: result = result + string[i]
print("\nAfter removing Vowels: ",result)
OUTPUT:-
Enter the string : you are brave
17.Write a Program to accept a character from the user and display whether it is a vowel or consonant.
ch = input("Enter a character: ") if(ch=='A' or ch=='a' or
ch=='E' or ch =='e' or ch=='I' or ch=='i' or ch=='O' or
ch=='o' or ch=='U' or ch=='u'):
print(ch, "is a Vowel") else:
print(ch, "is a Consonant")
OUTPUT:-
Enter a character: A
A is a Vowel
OUTPUT:-
Enter the value of 'n': 10
Fibonacci Series: 0 1 1 2 3 5 8 13 21 34
19. Write a Program to accept a number and check whether that number palindrome or not.
n=int(input("Enter number:")) temp=n rev=0
while(n>0): dig=n%10 rev=rev*10+dig n=n//10
if(temp==rev):
print("The number is a palindrome!") else:
print("The number isn't a palindrome!")
OUTPUT:-
Enter a Char 1 : india
Enter a Char 2 : india True