Friday, February 1, 2019

Remove Vowels

  • Problem Description

    Write a program that accepts a string and redisplays the same string after removing vowels from it.
  • CODING ARENA
  • def rem_vowel(string):
        vowels = ('a', 'e', 'i', 'o', 'u','A','E','I','O','U') 
        for x in string:
            if x in vowels:
                string = string.replace(x, "")
                 
        print(string)
     
    string = input()
    rem_vowel(string)

  • Test Case 1

    Input (stdin)
    welcome
    
    
    Expected Output
    wlcm
  • Test Case 2

    Input (stdin)
    indian navy
    
    
    Expected Output
    ndn nvy

No comments:

Post a Comment