0
Why i can't define this function to print words in reverse order?
2 Respostas
+ 1
You have to understand. Variable used as argument vs parameter here word is a parameter .It is called argument in function call.You use hello as variable name not as argument .it must be a string written enter double quotes "hello".Then to reverse a string we use slicing string[::-1] for example.
+ 1
:) there is no variable declared as drow!
you have one parameter called word.
So, in function you need to do something with this variable and then return result, or just print
as HBhZ_C said,
def flip(word):
return word[::-1]