def disemvowel(string_): vowels = ["a", "e", "i", "o", "u"] new_txt = "" for i in range(len(string_)): if string_[i].lower() in vowels: continue else: new_txt += string_[i] return new_txt
- def disemvowel(string_):
list_of_oo = ["a", "e", "i", "o", "u", "O" ,"A" ,"E" ,"I"]newset = ""n = 0while n < len(list_of_oo):for i in string_:if list_of_oo[n] == i:string_ = string_.replace(i , "-")print(list_of_oo[n])n += 1return string_- vowels = ["a", "e", "i", "o", "u"]
- new_txt = ""
- for i in range(len(string_)):
- if string_[i].lower() in vowels:
- continue
- else:
- new_txt += string_[i]
- return new_txt
import codewars_test as test # TODO Write tests import solution # or from solution import example # test.assert_equals(actual, expected, [optional] message) @test.describe("Example") def test_group(): @test.it("test case") def hi_guys(): test.assert_equals(disemvowel("HI GUYS"), "H GYS") test.assert_equals(disemvowel("AEIOU"), "") test.assert_equals(disemvowel("Shrek is an orge"), "Shrk s n rg")
- import codewars_test as test
- # TODO Write tests
- import solution # or from solution import example
- # test.assert_equals(actual, expected, [optional] message)
- @test.describe("Example")
- def test_group():
- @test.it("test case")
- def hi_guys():
- test.assert_equals(disemvowel("HI GUYS"), "H GYS")
- test.assert_equals(disemvowel("AEIOU"), "")
- test.assert_equals(disemvowel("Shrek is an orge"), "Shrk s n rg")