Skip to content

Instantly share code, notes, and snippets.

@ImOmkar
Created August 18, 2018 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ImOmkar/11633e17fba074c593968597e5e371d7 to your computer and use it in GitHub Desktop.
Save ImOmkar/11633e17fba074c593968597e5e371d7 to your computer and use it in GitHub Desktop.
WAP to check whether the string is starting with vowel or not.
#WAP to count the total number of vowel in a string
user=input("Enter: \n")
vowels=0
vowels+=user.count('a')
vowels+=user.count('e')
vowels+=user.count('i')
vowels+=user.count('o')
vowels+=user.count('u')
print("We found",vowels,"vowels")
#WAP to check whether the string is starting with vowel or not.
user=input("Enter a string: \n")
if(user.startswith('a') or user.startswith('e') or user.startswith('i') or user.startswith('o') or user.startswith('u') or user.startswith('A') or user.startswith('E') or user.startswith('I') or user.startswith('O') or user.startswith('U')):
print("String is starting with vowel")
else:
print("String is not starting with vowel")
#WAP to take name and the contact number from user and check whether it is correct value or not.
name=input("Enter your name: \n")
number=input("Enter your mobile number: \n")
if (len(name)>2 and len(number)==10):
print("correct details")
else:
print("wrong details")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment