Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python3 vowels and consonants filter

def anti_vowel(c):
    newstr = c
    vowels = ('a', 'e', 'i', 'o', 'u')
    for x in c.lower():
        if x in vowels:
            newstr = newstr.replace(x,"")

    return newstr
Comment

python3 vowels and consonants filter

def eliminate_consonants(x):
        vowels= ['a','e','i','o','u']
        for char in x:
            if char in vowels:
                print(char,end = "")

eliminate_consonants('mississippi')
Comment

python3 vowels and consonants filter

letterList = ['a', 'b', 'c', 'd']
vowelList = []

for letter in letterList:
    if letter in 'aeiou':
        vowelList.append(letter)
Comment

python3 vowels and consonants filter

def getVowels(text):

vowel_letters = []
vowel_list = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U',]

for vowels in text:
    if vowels in vowel_list:
        vowel_letters.append(vowels)

return vowel_letters

print(getVowels('Hi, How are you today!'))
## Output: ['i', 'o', 'a', 'e', 'o', 'u', 'o', 'a']
Comment

python3 vowels and consonants filter

def anti_vowel(text):
  new_text = ""
  for i in text:
    if i == 'a' or i == 'A':
      pass
    elif i == 'e' or i == 'E':
      pass
    elif i == 'I' or i == 'i':
      pass
    elif i == 'o' or i == 'O':
      pass
    elif i == 'u' or i == 'U':
      pass
    else:
      new_text = new_text + i
  return new_text

print anti_vowel('Hey look Words!')
Comment

python3 vowels and consonants filter

class Vowels(object):
    def __init__(self, vowelList):
        self.vowelList = vowelList

        lettersList = self.vowelList.s.split(",")
        self.vowelList = [letter for letter in self.lettersList if letter in 'aeiou']
Comment

PREVIOUS NEXT
Code Example
Python :: import CreateAPIView django 
Python :: pyplot histogram labels in center 
Python :: exchange sort python 
Python :: get linkinstance revit api 
Python :: pip install not happening in python cmd 
Python :: print something after sec python 
Python :: print(shahzaib) 
Python :: python web server oneliner 
Python :: ID number zero python 
Python :: Use in in django while preserving order 
Python :: file = Root() path = file.fileDialog() print("PATH = ", path) 
Python :: renpy quickstart 
Python :: rabin karp algorithm 
Python :: feed-forward network medium 
Shell :: how to check laptop serial number in ubuntu 
Shell :: push empty commit 
Shell :: uninstall node js in ubunt 
Shell :: Failed to start docker.service: Unit docker.service is masked 
Shell :: apache2.service is not active cannot reload. ubuntu 
Shell :: git clean cache 
Shell :: Your account is limited to 1 simultaneous ngrok client session. 
Shell :: How to restart Ubuntu via SSH? 
Shell :: copy ssh key ubuntu 
Shell :: enabling ufw 
Shell :: remove heroku remote 
Shell :: ubuntu command ram info 
Shell :: restart crontab 
Shell :: shutdown pc in 10 minutes 
Shell :: git rename master to main 
Shell :: regex for ips 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =