string=input("Please enter string: ") vowels=0 for i in string: if(i=='a' or i=='e' or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or =='I' or i=='O' or i=='U'): vowels=vowels+1 print("Number of vowels in string are:") print(vowels) Output 1: Please enter string: programming language Number of vowels in string are: 7 Output 2: Please enter string: vowels program Number of vowels in string are: 4
इन्हें भी देखें।
- while loop
- for loop
- nested loops
- loop control statements (Break, Continue, Pass)
- if statement
- if-else statement
- if-elif statement
- nested if statement
- range() function
- keywords
- Identifiers (names)
- Literals
- Operators
- punctuatorts
Python Programs के लिये यहाँ click करें।