Created
August 18, 2018 17:39
-
-
Save ImOmkar/11633e17fba074c593968597e5e371d7 to your computer and use it in GitHub Desktop.
WAP to check whether the string is starting with vowel or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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