Very confused why the return
function doesn't return my variable to the screen when I run it using pycharm. the print
function works perfectly fine but I'm trying to use return
when writing functions. any help appreciated. here is the code I'm trying with:
def disemvowel(string):
message = []
vowels = ['a', 'e', 'i', 'o', 'u']
for letter in string:
if letter not in vowels:
message.append(letter)
return message
disemvowel('laol')
if I substitute return
with print
it works the way I intend it to work
Once again any help appreciated