0
Extra terrestrials Python solution
Can anyone tell me what is wrong with this code? String reverse does not have any effect. def greeting(): print ("hello") print (greeting()[::-1])
6 Respuestas
+ 3
HonFu for the test cases do I need to get them all to work at the same time or seperate. also test cases 3-5 are hidden for some reason
+ 2
You need to return the string instead of printing it in the function.
+ 2
# try:
def greeting():
return "hello"
print(greeting()[::-1])
+ 1
The description says you are supposed to take input once and run your code on it.
Imagine someone's sitting at the other end, running your code, entering different inputs.
If you set it up like that, it should work.
+ 1
string = input()
i = len(string) - 1
while i >= 0:
i = i - 1
print(string[i+1], end='')
Maybe this would help.
0
ill advice that you take Epsilon ︻╦̵̵͇̿̿̿̿╤── idea